delphi combobox style csOwnerDrawVariable

来源:百度知道 编辑:UC知道 时间:2024/05/28 10:32:53
我设计了一个程序:单击DBgrid某一项时,这一项对应的属性的数据会在combobox中显示,combobox的style属性起先设置为csDropDown,当我把combobox的style属性设置为csOwnerDrawVariable之后,单击DBGird中的选项时,combobox中没有显示对应数据,请问要怎么改,才能显示啊?
呼,终于弄明白了..
procedure TForm1.DBGrid1CellClick(Column: TColumn); //点击数据框里面的某个记录,可以显示在combobox中
begin
.....
combobox12.ItemIndex:=combobox12.Items.IndexOf(Trim(ADOQUERY1.fieldByname('通道幅值').AsString))
....
end;
呃,菜鸟我,感觉良好...........

所谓OwnerDraw(很多控件都有这个属性),就是要自己“画”显示结果(效果)的。

Look this:
csOwnerDrawVariable:
Creates an owner-draw drop-down list with no edit box. List items can have varying heights.