Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
UltraComboEditor - Set style of selected item
posted

Hi

I have a Winforms project, in which I have an UltraComboEditor. Some of the items that are represented in the UltraComboEditor are marked in a special way, to indicate that they are not in use. This is done when populating the items of the UltraComboEditor like so:

if (/*Some condition*/)
{
    comboTrees.Items[index].Appearance.ForeColor = SystemColors.InactiveCaptionText;
    comboTrees.Items[index].Appearance.FontData.Strikeout = DefaultableBoolean.True;
}

This gives a nice indication when the list is dropped down. Now, when an item is selected, I would like to keep that formatting, if it was not in use.

SubjectTree1, which is not in use, was selected - but when selected, it is not possible to see that it is not in use.

The only way I can achieve this is by setting the appearance for the entire UltraComboBox, making it look like all the items are not in use. Is there a way to only format the SelectedItem of an UltraComboEditor?

Best regards

   Lars

Parents
  • 469350
    Offline posted

    Hi Lars,

    The ComboEditor will not pick up the appearance of the text of the selected item. But it will pick up the image. So if you applied an image to each ValueListItem and used an image to indicate which ones are not in use, then that image would display when that item is selected.

    Another option, of course, is to trap when the selected item changes and apply an appearance to the control's edit area.

Reply Children