christha
asked on
Combobox, input when style = csOwnerDrawFixed
I want to draw different items in a
combobox with different colors.
My problem is that when style = csOwnerDrawFixed, it is no longer possible to enter text into the combobox. The delphi5 help-file says that :
" csOwnerDrawFixed :Creates an owner-draw drop-down list with an edit box for manually entered text."
What am I doing wrong ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried changing the style to
csOwnerdraw and back, but the result was sort of unpredictable.
The "fake" combobox ( editbox with
a listbox attached) works fine.
Great idea!
Thanks :-)
use a edit component is very easy.
set edit.borderstyle=bsnone
put it on the combobox
add some events:
...
procedure TForm1.ComboBox1Change(Sen
begin
Edit1.Text:=ComboBox1.Text
end;
...
and you can add some codes in the combobox.onenter & onexit event to control the edit 's enabled or visibled.
menxin