I have managed to sort this problem using the OwnerDraw method.  THe result
is great.

JohnB 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Henry Bartlett
Sent: 02 December 2007 20:57
To: Borland's Delphi Discussion List
Subject: Re: Dumb question about ComboBoxes

> Is it possible to enable individual items in the list of items.
> I want to show a complete list of items but only show specific items 
> as being enabled and therefore selectable.
> I am sure I have done this before but damned if I can remember how.

John
I would rebuild the list of items each time, something like this:

mycombobox.items.clear;
if condition1 then
  mycombobox.items.Add('Method1');
if condition2 then
  mycombobox.items.Add('Method2');
if condition1 then
  mycombobox.items.Add('Method3');
...etc;

Of course you would need to keep track of each item's position in order to
respond to the combobox's OnClick event.

Henry Bartlett
email: hambar at microtech dot com dot au



_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to