Hi,
I have an issue with AppStylist on UltraGroupbox with 3 user controls. User control1 has Last, first and MI textboxes. User Control2 has street line1,line2, city, state and zip controls. User Controls3 has phone and other controls. At first, I could not able to see the gradient back color covering the entire Ultra Groupbox. I realised that it was due to user control back color and so I changed the user control back color to Transparent. Now I can see the whole gradient colors covering the entire Ultra Groupbox, but it was taking time to paint the screen while scrolling. I can see the controls get painted one after the other and is not acceptable. How could I achieve the Gradient colors for an Ultra Groupbox without changing the backcolor of user controls to Transparent? Well I opened the style library and the User control under the inbox controls did not have options to inherit colors from any other control. All I can do is only to set the back color. In my project, I was planning to give options to the user to choose one from the style library list (like in style library demo application) and change the style accordingly. I already know how to assign different styles at runtime but the sticky point is with the UserControl colors. I have the same problem with Panels too. I have user controls with multiple panels as well. Can anyone help me on how to achieve the Gradient colors for an Ultra Groupbox without changing the backcolor of user controls, panels to Transparent? Appreciate your help.
Just to let you know that I already added InboxControlStyler on the form.
Regards
Sivaram
In order to get the gradients of the child controls to line up with theparent (docked) group box, you should be able to use the BackGradientAlignment on the contained controls. Set it to Container and the gradient of that control will align to the containing control. Note that this probably won't work well with the ExpandableGroupBox, because the ExpandableGroupBox already has a child control within it. But it works okay for UltraGroupBox.
I added UltraGroupbox (dock = fill) for every User control and like I anticipated the end result is like patches (instead of uniform gradient back color) in the main UltraGroupBox. The styles that has just plain color seems to be ok but not with gradient colors. I am running out of options. Are there any better approaches?
Hi Mike,
Thanks for the reply. Actually I thought about adding UltraGroupbox (dock = fill) for every User control, but it will become an UltraGroupBox with multiple UltraGroupBoxes and the Gradient back color might not be uniform like having all the controls under a single UltraGroupBox. Any how I will try and see how it look? Any other ideas are appreciated.
Thanks
Hi Sivaram,
The problem occurs because of the regioning of the UltraGroupBox control and the way DotNet controls deal with Transparency. Unfortunately, there's nothing we can do about this, it's just a limitation of DotNet.
One thing you could try is to place a control inside the Usercontrol that draws the same gradient background that the GroupBox is using. For example, put an UltraLabel or an UltraPictureBox on the UserControl and dock it to fill. Then you need to set the the GradientOrigin so that it uses it's parent control as the origin instead of itself. I forget which setting this is for GradientOrigin, maybe Container, but you can experiment with the different options and see which one works.