Вопрос Command line switch to every combobox items?

thebig1825

Новичок
I want to add command line switches to items from this combobox:

NewComboBox1 := TNewComboBox.Create(WizardForm);
with NewComboBox1 do begin
Parent := Component.Surface;
Left := ScaleX(5);
Top := ScaleY(180);
Width := ScaleX(170);
Height := ScaleY(21);
Style := csDropDownList;
Items.Add('Item1');
Items.Add('Item2');

function myitem1: Boolean;
begin
Result: = NewComboBox1.ItemIndex = 0
end;

function myitem2: Boolean;
begin
Result: = NewComboBox1.ItemIndex = 1
end;
 
Последнее редактирование:

sergey3695

Ветеран
Модератор
thebig1825,
Код:
function CheckParam(s: string): boolean;
var
i: integer;
begin
  for i := 0 to ParamCount do begin
    Result := ParamStr(i) = s;
    if Result then Break;
  end;
end;
// Checked := CheckParam('/item1') or blabla;
// i:= 0..!
 
Последнее редактирование:

thebig1825

Новичок
thebig1825,
Код:
function CheckParam(s: string): boolean;
var
i: integer;
begin
  for i := 0 to ParamCount do begin
    Result := ParamStr(i) = s;
    if Result then Break;
  end;
end;
// Checked := CheckParam('/item1') or blabla;
// i:= 0..!
Хорошо, но как заставить его работать с
Код:
  NewComboBox1 := TNewComboBox.Create(WizardForm);
  with NewComboBox1 do begin
    Parent := Copmp2;
    Left := ScaleX(25);
    Top := ScaleY(25);
    Width := ScaleX(170);
    Height := ScaleY(21);
    Style := csDropDownList;
    Items.Add('item1');
 

sergey3695

Ветеран
Модератор
thebig1825,
Код:
function myitem1: Boolean;
begin
Result: = (NewComboBox1.ItemIndex = 0) or CheckParam('/item0');
end;
?
 
Сверху