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?
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
Is there anything else you need?
I got it working about two weeks before your initial response, doing element resizing immediately after adding the custom elements. It turns out most of what I needed to do was already in the Infragistics API, but everything was marked as internal; only found this out by some very deep reflector work. I'm really beginning to hate the internal keyword when it comes to Infragistics code - I've yet to come across something that was marked as internal that shouldn't have been made public. It just makes working with the API horrible if you need to do something just slightly out of the norm, knowing that the code you want is there but hidden.
Sorry for the mini rant, but thanks for the eventual response.