Export (0) Print
Expand All

How to: Enable Windows XP Visual Styles 

Visual style is the user-modifiable appearance of the user interface of an application or operating system. By default, Windows XP provides a new visual style. The scroll bars and title bar of a Windows Form will automatically use the new visual style when the form is run on Windows XP. If your application calls the EnableVisualStyles method, most of your Windows Forms controls will automatically use the visual style when your application is run on Windows XP.

NoteNote

Windows XP visual styles support can also be enabled through the Enable Visual Styles check box in the Application pane of the Project Designer. For more information, see the topic How to: Enable Visual Styles.

To enable visual styles

  • To enable visual styles in the client area of a Windows form, add the following code to your application's Main method.

    Application.EnableVisualStyles()
    
    

    Application.EnableVisualStyles();
    
    NoteNote

    There are some Windows Forms controls that will look the same on all operating systems; implementing EnableVisualStyles has does not affect these controls. These include the Label, LinkLabel, DomainUpDown, NumericUpDown, and CheckedListBox controls. Additionally, if you enable visual styles on some controls, the control might display incorrectly in certain situations. These include the MonthCalendar control with a selection range set, the TabControl with tab pages aligned at the bottom or sides of the control, and the handling of surrogate fonts in the TextBox control.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft