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
215
Office 2007 theme on the Messagebox control
posted

Hello Infragistics support,

So I hooked up the Ultramessagbox and found that the buttons are the standard xp buttons. I wanted to apply the Office 2007 theme.

I'm largely wanting to avoid the question of the stylist application and so tried the following:

UltraMessageBoxInfo info = new UltraMessageBoxInfo();

info.ButtonAppearance.BackColor = Office2007ColorTable.Colors.ButtonBackColor;

etc.........

Unfortunately this didn't work.

I'm using the stylist for a single element (<style role="ListViewColumnHeader">) so I thought I would be able to easily edit it to incorporate this. Unfortunately my efforts were unsuccesful I imported the 2 available resources for normal and hot- tracking from the supplied isl files but the buttons would not update. I have attached the file and would appreciate any pointers there.

I just want to set the Office 2007 theme on the messagebox buttons, can you tell me what I need to do to get the messagebox to open with the equivalent of a ViewStyle = Office2007?

As a aside, I would encourage you to seriously consider providing straight forward themes that can be assigned using properties. I have found this appstyle thing to be largely unsatisfactory and a serious  time sink.

DevExpress provides skins for their controls, I pick the one I want and I'm done. All color variations are covered. That way I can get on with the work at hand. With your stuff, there seems to be no way to theme a basic button so it is consistent for active/hover and pressed etc. I have to go to stylist and work out border colours for when a button is in hover or pressed state. I thought you guys had that all figured out? Just let me know which switch I need to flick.

I'd just like to get stuff done not fiddle with colour schemes.

 

Thanks

 

Here's my isl file

 

<?xml version="1.0" encoding="utf-8"?>

<styleLibrary>

  <annotation>

    <lastModified>2010-08-06T22:59:26</lastModified>

  </annotation>

  <styleSets defaultStyleSet="ListViewHeader">

    <styleSet name="ListViewHeader">

      <styles>

        <style role="ListViewColumnHeader">

          <states>

            <state name="Normal">

              <resources>

                <name>GridColumnHeader_Normal</name>

              </resources>

            </state>

          </states>

        </style>        

      </styles>

    </styleSet>

  </styleSets>

  <resources>    

    <resource name="GridColumnHeader_Normal" backColor="244, 247, 250" foreColor="64, 94, 131" borderColor="191, 197, 210" imageBackgroundStyle="Stretched" backColor2="211, 220, 233" backGradientStyle="Vertical" imageBackgroundStretchMargins="2, 2, 2, 2" />

  </resources>

</styleLibrary>

 

 

  • 6158
    Suggested Answer
    Offline posted

    Hello,

    Our Application Styling Framework is designed to provide the maximum amount of flexibility by allowing developers with an eye for visual design the ability to fully restyle their applications, while also providing application-wide themes with minimal amount of work.

    As part of the NetAdvantage installation, we provided a number of style libraries that you can choose from. Our visual design team has created style libraries for the all three of the Office 2007 color schemes (Blue, Black, and Silver). These libraries (Office2007Blue, Office2007Black, and Office2007SilveR) should have been placed in a sub-folder of the installation directory as part of the installation.  In your situation, you can simply copy one of these style libraries (.isl) to your project, and call the appropriate Infragistcs.Win.AppStyling.StyleManager.Load() method. Note that this will restyle your entire application with the Office2007 styling. If you want only the UltraMessageBox to be affected by this style library, you should use one of the Load() overrides which allows you to assign a StyleLibraryName. You should then assign the same name to the StyleLibraryName property on the UltraMessageBoxManager.

    Additionally, let me address the other issues you were encountering while trying to restyle the UltraMessageBox buttons.

    In order to provide system-themed buttons on the UltraMessageBox by default, we had to leave theming enabled on those buttons. This means we use allow the system to draw the buttons. Unfortunately, the OS does not provide a means to specify the styling information such as coloring as part of the API. Therefore, the buttons are continually drawn the same way independent of the settings on the appearances. In order to apply these colors, you will have to set the UseOSThemes property on the UltraMessageBoxManager to False. This will remove some of the theming benefits such as corner rounding. We are able to achieve both round corners and custom colors within our style libraries by applying images.

    In regards to the style library information you provided, the styling here would apply only to the ColumnHeader of a ListView. This is due to the assigned role. When resolving their appearance, elements in our framework look for specific UIRoles. The items of the UltraMessageBox have their own roles (in addition to inheriting from base UIRoles). The resources you imported would have to be applied to each specific UIRole or onto one of the base UIRoles which affect all the buttons within the application.

    Please let me know if you require further assistance.

    Thanks,

    Chris