Changeset 1500


Ignore:
Timestamp:
01/11/10 06:56:45 (5 years ago)
Author:
lowjoel
Message:

Set the FlatStyle? of abstract buttons to System so that Vista/7 fading visuals can be used (we don't ownerdraw anyway)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Util/UxThemeApi.cs

    r1431 r1500  
    4444                    control.Font.Size, control.Font.Style); 
    4545 
    46             if (control is ListView) 
     46            if (control is ButtonBase) 
     47                UpdateControlTheme((ButtonBase)control); 
     48            else if (control is ListView) 
    4749                UpdateControlTheme((ListView)control); 
    4850            else if (control is ToolStrip) 
     
    5456            foreach (Control child in control.Controls) 
    5557                UpdateControlTheme(child); 
     58        } 
     59 
     60        /// <summary> 
     61        /// Updates the control's theme to fit in with the latest Windows visuals. 
     62        /// </summary> 
     63        /// <param name="button">The ButtonBase control to set the theme on.</param> 
     64        public static void UpdateControlTheme(ButtonBase button) 
     65        { 
     66            if (button.FlatStyle == FlatStyle.Standard) 
     67                button.FlatStyle = FlatStyle.System; 
    5668        } 
    5769 
Note: See TracChangeset for help on using the changeset viewer.