Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Thu Apr 24, 2008 2:37 pm Post subject: HOWTO: Enable Windows XP Visual Styles for a property sheet extension |
|
|
To enable Windows XP Visual Styles (themes) for a property sheet extension, call the Application.EnableVisualStyles method at the very beginning of the constructor of the PropertySheetExtension derived class as follows :
[C#]
// AssemblyInfo is a PropertySheetExtension derived class
public AssemblyInfo()
{
Application.EnableVisualStyles();
InitializeComponent();
}
[VB.Net]
' AssemblyInfo is a PropertySheetExtension derived class
Public Sub New()
MyBase.New()
Application.EnableVisualStyles()
InitializeComponent()
End Sub
Notes
Set the BackColor property of the PropertySheetExtension to Transparent to make sure that the child controls such as labels are drawn correctly when using XP visual styles. |
|