Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.05.30;
Скачать: CL | DM;

Вниз

Вытащить инфу из RT компонентов   Найти похожие ветки 

 
SCH   (2004-05-17 14:45) [0]

Созданы в RunTime несколько ComboBox. Как по их индексу узнать в каком комбо, какая строка выбрана.
Заранее благодарен.


 
PVOzerski ©   (2004-05-17 14:54) [1]

А что такое индекс ComboBox"а?


 
Skier ©   (2004-05-17 14:55) [2]

Owner.Components[...]
TComboBox.ComponentIndex
TComboBox.ItemIndex
?


 
PVOzerski ©   (2004-05-17 15:02) [3]

А что такое индекс ComboBox"а?


 
Polevi ©   (2004-05-17 15:11) [4]

procedure TForm1.FormCreate(Sender: TObject);
begin
 with TCombobox.Create(self) do
 begin
   Parent:=self;
   Name:="Combo1";
   OnChange:=ComboBoxOnChange;
   Top:=0;
   Items.Add("One");
   Items.Add("Two");
 end;
 with TCombobox.Create(self) do
 begin
   Parent:=self;
   Name:="Combo2";
   OnChange:=ComboBoxOnChange;
   Top:=20;
   Items.Add("One");
   Items.Add("Two");
 end;
end;

procedure TForm1.ComboBoxOnChange(Sender: TObject);
var
 cb:TCombobox;
begin
 cb:=TComboBox(Sender);
 ShowMessage(Format("%s - %s",[cb.Name,cb.Items[cb.ItemIndex]]));
end;


 
WebErr ©   (2004-05-17 15:16) [5]

В конце концов можно самому придумывать индексы TComboBox"ов просто присваивая свойству Tag новое значение. :)



Страницы: 1 вся ветка

Текущий архив: 2004.05.30;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.054 c
14-1084192555
evvcom
2004-05-10 16:35
2004.05.30
Отдых в Украине


8-1072430595
undersun
2003-12-26 12:23
2004.05.30
DSPack.SampleGrabber не грабит с камеры


1-1084779160
Lera
2004-05-17 11:32
2004.05.30
TList.Sort


1-1084320585
Dweller
2004-05-12 04:09
2004.05.30
Как подключить Matlab DLL к Delphi


11-1074438248
Neznaika
2004-01-18 18:04
2004.05.30
MHLame для Delphi6