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