Ticket Q287327
Visible to All Users

How to change the caption back color of a certain DockPanel when a panel is auto-hidden

created 13 years ago

I wish to oONLY change the background color of ONE tab, not all of them. How do I accomplish this.
Even if I wish to change all of the "Backcolors" that does not work.
I would like code to change the color.
Can you provide me a demo with multiple tabs demonstrating how to change the color of a single tab a different color via code?

Answers

created 13 years ago (modified 13 years ago)

As it is stated in the documentation, in Windows XP and any skinning painting scheme, only the Font and ForeColor properties are in effect. If you want to use the BarAndDockingController to change background colors, it is necessary to change the style to Flat via the BarAndDockingController.LookAndFeel.Style property and set the BarAndDockingController.LookAndFeel.UseDefaultLookAndFeel property to false.
The BarAndDockingController allows you to change the appearance of all DockPanels. To change the appearance of a certain DockPanel, use the DockPanel.Appearance property.
DockPanels do not provide settings to change the caption background color. To accomplish this task, use the approach demonstrated in the How to implement the custom draw functionality for skinned dock panels example.

    Show previous comments (1)
    DevExpress Support Team 12 years ago

      Hello Harold,
      Attached is a sample project demonstrating how to create your own paint style and paint auto-hidden panel headers manually by overriding the HideBarSkinPainter.DrawButtonHeaderBackground method.
      Please let me know, if you need any further assistance.

        Could you add one more dockpanel on the left and only color ONE of the two panel tabs when the panels are closed? That is the essesence of the problem.
        Thanks
        Harold

        DevExpress Support Team 12 years ago

          Hello Harold,
          You can use the AutoHideButtonHeaderInfo.IsHot property to determine the state of the button header:

          C#
          protected override void DrawButtonHeaderBackground(GraphicsCache cache, AutoHideButtonHeaderInfo headerInfo) { if (headerInfo.IsHot) base.DrawButtonHeaderBackground(cache, headerInfo); else cache.FillRectangle(Brushes.Yellow, headerInfo.GetRelativeRect(headerInfo.Bounds)); }

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.