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
315
How to change appearance(Background) of AutoComplete suggestions in an UltraComboEditor
posted

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;
    }
}

Parents
  • 4625
    Offline posted

    Hi,

    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.

Reply Children
No Data