Provides methods used to render a text box control with visual styles. This class cannot be inherited.
See Also: TextBoxRenderer Members
The System.Windows.Forms.TextBoxRenderer class provides a set of static methods that can be used to render a text box control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a text box, use one of the erload:System.Windows.Forms.TextBoxRenderer.DrawTextBox methods. These methods provide a variety of options, such as applying text formatting or specifying text bounds.
If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, erload:System.Windows.Forms.TextBoxRenderer.DrawTextBox will draw the text box with the current visual style. Otherwise, erload:System.Windows.Forms.TextBoxRenderer.DrawTextBox will throw an InvalidOperationException. To determine whether the members of this class can be used, you can check the value of the TextBoxRenderer.IsSupported property.
This class wraps the functionality of a System.Windows.Forms.VisualStyles.VisualStyleRenderer that is set to one of the elements of the System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox.TextEdit class. For more information, see Rendering Controls with Visual Styles.