SystemPens Class
Each property of the SystemPens class is a Pen that is the color of a Windows display element and that has a width of 1 pixel.
Assembly: System.Drawing (in System.Drawing.dll)
The SystemPens type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | ActiveBorder | Gets a Pen that is the color of the active window's border. |
![]() ![]() | ActiveCaption | Gets a Pen that is the color of the background of the active window's title bar. |
![]() ![]() | ActiveCaptionText | Gets a Pen that is the color of the text in the active window's title bar. |
![]() ![]() | AppWorkspace | Gets a Pen that is the color of the application workspace. |
![]() ![]() | ButtonFace | Gets a Pen that is the face color of a 3-D element. |
![]() ![]() | ButtonHighlight | Gets a Pen that is the highlight color of a 3-D element. |
![]() ![]() | ButtonShadow | Gets a Pen that is the shadow color of a 3-D element. |
![]() ![]() | Control | Gets a Pen that is the face color of a 3-D element. |
![]() ![]() | ControlDark | Gets a Pen that is the shadow color of a 3-D element. |
![]() ![]() | ControlDarkDark | Gets a Pen that is the dark shadow color of a 3-D element. |
![]() ![]() | ControlLight | Gets a Pen that is the light color of a 3-D element. |
![]() ![]() | ControlLightLight | Gets a Pen that is the highlight color of a 3-D element. |
![]() ![]() | ControlText | Gets a Pen that is the color of text in a 3-D element. |
![]() ![]() | Desktop | Gets a Pen that is the color of the Windows desktop. |
![]() ![]() | GradientActiveCaption | Gets a Pen that is the lightest color in the color gradient of an active window's title bar. |
![]() ![]() | GradientInactiveCaption | Gets a Pen that is the lightest color in the color gradient of an inactive window's title bar. |
![]() ![]() | GrayText | Gets a Pen that is the color of dimmed text. |
![]() ![]() | Highlight | Gets a Pen that is the color of the background of selected items. |
![]() ![]() | HighlightText | Gets a Pen that is the color of the text of selected items. |
![]() ![]() | HotTrack | Gets a Pen that is the color used to designate a hot-tracked item. |
![]() ![]() | InactiveBorder | Gets a Pen is the color of the border of an inactive window. |
![]() ![]() | InactiveCaption | Gets a Pen that is the color of the title bar caption of an inactive window. |
![]() ![]() | InactiveCaptionText | Gets a Pen that is the color of the text in an inactive window's title bar. |
![]() ![]() | Info | Gets a Pen that is the color of the background of a ToolTip. |
![]() ![]() | InfoText | Gets a Pen that is the color of the text of a ToolTip. |
![]() ![]() | Menu | Gets a Pen that is the color of a menu's background. |
![]() ![]() | MenuBar | Gets a Pen that is the color of the background of a menu bar. |
![]() ![]() | MenuHighlight | Gets a Pen that is the color used to highlight menu items when the menu appears as a flat menu. |
![]() ![]() | MenuText | Gets a Pen that is the color of a menu's text. |
![]() ![]() | ScrollBar | Gets a Pen that is the color of the background of a scroll bar. |
![]() ![]() | Window | Gets a Pen that is the color of the background in the client area of a window. |
![]() ![]() | WindowFrame | Gets a Pen that is the color of a window frame. |
![]() ![]() | WindowText | Gets a Pen that is the color of the text in the client area of a window. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | FromSystemColor | Creates a Pen from the specified Color. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The following code example creates points and sizes using several of the overloaded operators defined for these types. It also demonstrates how to use the SystemPens class.
This example is designed to be used with Windows Forms. Create a form that contains a Button named subtractButton. Paste the code into the form and call the CreatePointsAndSizes method from the form's Paint event-handling method, passing e as PaintEventArgs.
void CreatePointsAndSizes( PaintEventArgs^ e ) { // Create the starting point. Point startPoint = Point(subtractButton->Size); // Use the addition operator to get the end point. Point endPoint = startPoint + System::Drawing::Size( 140, 150 ); // Draw a line between the points. e->Graphics->DrawLine( SystemPens::Highlight, startPoint, endPoint ); // Convert the starting point to a size and compare it to the // subtractButton size. System::Drawing::Size buttonSize = (System::Drawing::Size)startPoint; if ( buttonSize == subtractButton->Size ) { e->Graphics->DrawString( "The sizes are equal.", gcnew System::Drawing::Font( this->Font,FontStyle::Italic ), Brushes::Indigo, 10.0F, 65.0F ); } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
