System.Windows.Forms.VisualStyles.VisualStyleElement Class

Identifies a control or user interface (UI) element that is drawn with visual styles.

See Also: VisualStyleElement Members

Syntax

public class VisualStyleElement

Remarks

The System.Windows.Forms.VisualStyles.VisualStyleElement class identifies a Windows control or user interface (UI) element that is defined by the current visual style of the operating system. A visual style element is defined in terms of class, part, and state:

The System.Windows.Forms.VisualStyles namespace exposes hundreds of System.Windows.Forms.VisualStyles.VisualStyleElement objects that represent the controls and user interface elements that can be defined by a visual style. These objects are exposed as static properties of nested classes of System.Windows.Forms.VisualStyles.VisualStyleElement. For each property, the qualified name of the owning class represents the class and the part of the drawn element, and the property name represents the state of the element. For example, the System.Windows.Forms.VisualStyles.VisualStyleElement.Button.PushButton.Pressed property returns a System.Windows.Forms.VisualStyles.VisualStyleElement that can be used to draw a button in the pressed state with visual styles. The Pressed property name corresponds to the state, PushButton corresponds to the part, and Button identifies the class of the visual style element.

To draw a visual style element, create a System.Windows.Forms.VisualStyles.VisualStyleRenderer, set it to the System.Windows.Forms.VisualStyles.VisualStyleElement you wish to draw, and then call the erload:System.Windows.Forms.VisualStyles.VisualStyleRenderer.DrawBackground method. To determine whether the current visual style provides a definition for a particular element, call the VisualStyleRenderer.IsElementDefined(VisualStyleElement) method with the element as the argument.

System.Windows.Forms.VisualStyles.VisualStyleElement and System.Windows.Forms.VisualStyles.VisualStyleRenderer wrap the functionality of the visual styles API from the Windows Shell portion of the Windows Platform SDK. For more information on visual styles, see "Using Windows XP Visual Styles" in the Platform SDK portion of the MSDN Library at tp://msdn.microsoft.com/library/.

Requirements

Namespace: System.Windows.Forms.VisualStyles
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0