Hi,
I read the "How to change appearance of AutoComplete suggestions in an UltraComboEditor" topic, and the sample worked for me.
But when I tried to change the background color, the settings was not working anymore.
Is there any other setting to make to set the background color to highlight autocomplete text which overwrite the background color?
here is the code:
public class SuggestTextDrawFilter : IUIElementDrawFilter{ public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { if (drawParams.Font.Bold) { drawParams.AppearanceData.FontData.Bold = DefaultableBoolean.False; drawParams.AppearanceData.BackColor = Color.Blue; } return false; } public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams) { if (drawParams.Element is TextSectionUIElement && drawParams.Element.Parent is FormattedTextUIElement) return DrawPhase.BeforeDrawElement; return DrawPhase.None; }}
After discussion with our development team and according to these two forum threads at https://es.infragistics.com/community/forums/t/110099.aspx and https://es.infragistics.com/community/forums/p/29739/144401.aspx#144401 this color is resolved by the operating system settings and as long as you use ComboEditor and it uses TextBox as editing control we do not have the authority to change that color.
I want to change only the highlighted text.
I would like to let you know that currently I am working on your case and I will send you a progress update of possible solution regarding it. UltraComboEditor uses Microsoft’s TextBox when it is in edit mode. In order to change the highlight color of the TextBox, you have to override the OnPaint event handler and draw custom highlight rectangle. This is a theoretical workaround as I am currently investigating it further and let you know soon if that might do the trick in your scenario. That is why the draw filter does not work as per your expectations. Could you please clarify for me if you would like to change the color only of the highlighted text or the entire TextBox field?
Looking forward to hear from you.