Application::VisualStyleState Property
.NET Framework (current version)
Gets a value that specifies how visual styles are applied to application windows.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: property VisualStyleState VisualStyleState { static VisualStyleState get(); static void set(VisualStyleState value); }
Property Value
Type: System.Windows.Forms.VisualStyles::VisualStyleStateA bitwise combination of the System.Windows.Forms.VisualStyles::VisualStyleState values.
This VisualStyleState property determines whether visual styles are enabled in client areas or nonclient areas of application windows. Generally, this property should be set within the main form's constructor or Load event handler.
The following code example sets the VisualStyleState property to one of the System.Windows.Forms.VisualStyles::VisualStyleState values within the Click event handler for a Button control. This code example is part of a larger example provided for the System.Windows.Forms.VisualStyles::VisualStyleState enumeration.
private: void UpdateButton_Click(Object^ sender, EventArgs^ e) { if (applyToClient->Checked) { Application::VisualStyleState = VisualStyleState::ClientAreaEnabled; } else if (applyToNonClient->Checked) { Application::VisualStyleState = VisualStyleState::NonClientAreaEnabled; } else if (applyToAll->Checked) { Application::VisualStyleState = VisualStyleState::ClientAndNonClientAreasEnabled; } else if (disableStyles->Checked) { Application::VisualStyleState = VisualStyleState::NoneEnabled; } // Repaint the form and all child controls. this->Invalidate(true); }
.NET Framework
Available since 2.0
Available since 2.0
Show: