Ticket Q495968
Visible to All Users

XtraUserControl not applying current skin

created 12 years ago

Hi ,

We have a XtraUserControl and this control is filled to Windows Panel. In version 8.1 the UserControl was applying skin ,but in 12.1.5 version it is taking color from parent control's back color. I know there are some question/kb articles that says that this is by design.

Can I override some function or property so that XtraUserControl can apply the current skin to itself irrespective of back color of it parent?

Attached jpeg file shows the XtraUC at runtime and in VS design time

Comments (1)
PL PL
Praveen Lowanshi 12 years ago

    Any update?

    Answers approved by DevExpress Support

    created 12 years ago (modified 12 years ago)

    Hi,
    As far as I understand, you wish to customize the LookAndFeel of the XtraUserControl. If so, add the DefaultLookAndFeel component to the form and set a skin for the XtraUserControl.
    I have created a simple project to illustrate this approach. Feel free to contact us in case of further difficulties.

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

        Hi,
        By default, the XtraUserControl's backcolor is equal to the parent container's backcolor. In your scenario, I recommend you use one of the following approaches:

        1. Allocate a XtraUserControl instance inside a separate container, for example, inside a separate Panel control. Set this Panel control's LookAndFeel properties as shown below:
        C#
        PanelControl.LookAndFeel.SkinName = "Office 2013"; PanelControl.LookAndFeel.UseDefaultLookAndFeel = false;

        In this case, the XtraUserControl allocated inside such a Panel control will be painted with the Panel's backcolor.
        2. Alternatively, you can manually define a XtrauserControl.BackColor property value as required.
        In the attachment, you can find a simple sample which illustrates the 1st approach in action. As you can see, the Form and the XtraUserControl instances are painted with different skins.
        Is this what you are looking for?

        PL PL
        Praveen Lowanshi 12 years ago

          Do you have sample to get backcolor from current application skin and set this color to XtrauserControl.BackColor

          DevExpress Support Team 12 years ago

            Hello Praveen,
            Please refer to the How to get colors that correspond to the currently used skin KB article where you will find detailed information about how to get skin elements and colors these elements use. I hope it will be helpful to you.
            Do not hesitate to contact us again if you need further assistance.

            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.