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
710
Styling a label to match explorer bar group.
posted

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. 

Parents
No Data
Reply
  • 469350
    Offline posted

    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.

     

Children