I got it!
我用一个Timer控件监视ComboBox的这两个属性
发现SelText就是被选中的文本
不信你自己试一下!
object ComboBox1: TComboBox
Left = 24
Top = 16
Width = 145
Height = 21
ItemHeight = 13
TabOrder = 0
Text = 'ComboBox1'
Items.Strings = (
'10'
'20'
'30'
'40')
end
object ComboBox2: TComboBox
Left = 24
Top = 80
Width = 145
Height = 21
Style = csDropDownList
ItemHeight = 13
TabOrder = 1
Items.Strings = (
'aa'
'bb'
'cc'
'dd')
end
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Label1.Caption:=ComboBox1.Text+' | '+ComboBox1.SelText;
Label2.Caption:=ComboBox2.Text+' | '+ComboBox2.SelText;
end;
^_^