I have a explorer bar (dock left) and a panel (rest of form). I want a title on the panel which reflects the selected explorer bar group. I added a ultralabel docked to the top of the panel. What is the best way to style the label to look just like the explorer bar group?
Any reference to a tutorial? It is very, very frustrating trying to use your controls with the documentation that you provide. Is there any third party documentation available. Please don't ask, "What is missing?" EVERYTHING.
Hi,
Are you using Application Styling in your application? You are posting in the AppStylist forum, but since you are asking about styling an individual label control, I just want to make sure I understand what you are doing.
Or are you trying to do this in code?
If you are using AppStyling, then the style library will style all of the label controls in your application the same. In which case, styling a single individual label would be more complicated.
If you just want to do this in code, then what you would have to do is get the resolved appearance of the Explorer Group header at run-time and copy those properties to the appearance properties of the label. This will work in general, but it's really not a great approach because the header appearance itself may be relying on some other UIElement that is behind the header.
try something like this:
AppearanceData appearanceData = new AppearanceData(); AppearancePropFlags appearancePropFlags = AppearancePropFlags.AllRender; this.ultraExplorerBar1.Groups[0].ResolveHeaderAppearance(ref appearanceData, ref appearancePropFlags); this.ultraLabel1.Appearance.BackColor = appearanceData.BackColor; this.ultraLabel1.Appearance.BackColor2 = appearanceData.BackColor2; this.ultraLabel1.Appearance.BackGradientStyle = appearanceData.BackGradientStyle; this.ultraLabel1.Appearance.ForeColor = appearanceData.ForeColor; //etc.
Yes, I am using app styling. I was expecting to set the appearance of the label based on the style of the explorer bar header in code.
This label should be styled differenent than other labels. So, should I turn off app styling for the label? Is there a way to extract the style from the header, and apply the whole appearance to the label, without applying the individual properties?