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
1015
Using the ControlContainer style for a tool with a combo box user control cuts off the bottom of the combo box
posted

Hello all,

I'm currently working with an Infragistics 11.2 UltraToolbarsManager. I have a custom user control that looks just like a combo box in the designer, but has overloaded functionality at run time. What I'm currently having issues with is that I've added a tool in the ControlContainer style to my UltraToolbarManager's toolbar.

I added my user control to the form, and then set the Control property on the tool to my user control. It appears correctly at runtime, and works as expected.. EXCEPT that it cuts off the bottom portion of my user control (only by a pixel or two). It hides enough of the border that I've had comments about it not looking quite right, and I have to agree.

Can anyone offer any suggestions on how to prevent this incorrect display behavior?

I've attached a sample solution that displays the issue I'm experiencing at runtime.

Thanks!

UltraToolbarCutsOffUserControlBorder.zip
Parents
  • 71886
    Offline posted

    Hello,

    Thank you for the detailed explanations and the sample. You could decrease the combo editor uielement's width by using a CreationFilter. Please try the following code:

     

        class CF : IUIElementCreationFilter

        {

            public void AfterCreateChildElements(UIElement parent)

            {

                if (parent is UltraComboEditorUIElement)

                {

                    parent.Rect = new Rectangle(parent.Rect.X, parent.Rect.Y, parent.Rect.Width, 21);

                    parent.ChildElements[0].Rect = new Rectangle(parent.Rect.X, parent.Rect.Y, parent.Rect.Width, 21);

                }

            }

     

            public bool BeforeCreateChildElements(UIElement parent)

            {

                return false;

            }

        }

    Then assign it to the control:

        ultraComboEditor1.CreationFilter = new CF();

    Please feel free to let me know if I misunderstood you or if you have any other questions.

Reply Children
No Data