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
800
How to flow existing UIElements around custom elements?
posted

I've created a custom UIElement derived from the ButtonUIElementBase for creating right-aligned image buttons in the header of the UltraGroupBox, with different images for hot-tracking appearances.  The buttons are being added in the AfterCreateChildElements when the parent is the GroupBoxHeaderUIElement.  The buttons themselves are fully working, now I'm just having problems figuring out how to flow the other elements around the ones I'm adding.

The buttons are added to the right side of the header, and the text to the left of it needs to resize based on the new area remaining in the header.  The biggest problem is that when resized, the header will need to resize in height to fit the text and I just can't figure out how to do this.

Has anyone done something like this before? Or, have any idea how I may accomplish this?

Parents
No Data
Reply
  • 2197
    posted

    Hello.

    What you will need to do is change the size of the ImageAndTextDependentTextUIElement inside of the ImageAndTextUIElement. The GroupBoxHeaderUIElement is where you want to add the buttons. Inside of the GroupBoxHeaderUIElement there is the ImageAndTextUIElement and then inside of that is the ImageAndTextDependentTextUIElement. You will have to change the size of the rectangle of this UIElement in order to do your resizing.

    If you want to change the height of the header, there are other things that need to be considered besides the contents of the header itself. The controls in the UltraGroupBox have to know not to take up the space in the header. You can do this by overriding the DisplayRectangle. If more space is needed, you may have to derive from the UltraGroupBox and override the DisplayRectangle again to create more space at the top. After that, you will probably have to resize the ImageAndTextDependentTextUIElement and move it out of the way of the buttons.


    Charlie

Children