SystemPens Class
Collapse the table of content
Expand the table of content

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.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

System.Object
  System.Drawing.SystemPens

public sealed class SystemPens

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticActiveBorder

Gets a Pen that is the color of the active window's border.

System_CAPS_pubpropertySystem_CAPS_staticActiveCaption

Gets a Pen that is the color of the background of the active window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticActiveCaptionText

Gets a Pen that is the color of the text in the active window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticAppWorkspace

Gets a Pen that is the color of the application workspace.

System_CAPS_pubpropertySystem_CAPS_staticButtonFace

Gets a Pen that is the face color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticButtonHighlight

Gets a Pen that is the highlight color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticButtonShadow

Gets a Pen that is the shadow color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControl

Gets a Pen that is the face color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlDark

Gets a Pen that is the shadow color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlDarkDark

Gets a Pen that is the dark shadow color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlLight

Gets a Pen that is the light color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlLightLight

Gets a Pen that is the highlight color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlText

Gets a Pen that is the color of text in a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticDesktop

Gets a Pen that is the color of the Windows desktop.

System_CAPS_pubpropertySystem_CAPS_staticGradientActiveCaption

Gets a Pen that is the lightest color in the color gradient of an active window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticGradientInactiveCaption

Gets a Pen that is the lightest color in the color gradient of an inactive window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticGrayText

Gets a Pen that is the color of dimmed text.

System_CAPS_pubpropertySystem_CAPS_staticHighlight

Gets a Pen that is the color of the background of selected items.

System_CAPS_pubpropertySystem_CAPS_staticHighlightText

Gets a Pen that is the color of the text of selected items.

System_CAPS_pubpropertySystem_CAPS_staticHotTrack

Gets a Pen that is the color used to designate a hot-tracked item.

System_CAPS_pubpropertySystem_CAPS_staticInactiveBorder

Gets a Pen is the color of the border of an inactive window.

System_CAPS_pubpropertySystem_CAPS_staticInactiveCaption

Gets a Pen that is the color of the title bar caption of an inactive window.

System_CAPS_pubpropertySystem_CAPS_staticInactiveCaptionText

Gets a Pen that is the color of the text in an inactive window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticInfo

Gets a Pen that is the color of the background of a ToolTip.

System_CAPS_pubpropertySystem_CAPS_staticInfoText

Gets a Pen that is the color of the text of a ToolTip.

System_CAPS_pubpropertySystem_CAPS_staticMenu

Gets a Pen that is the color of a menu's background.

System_CAPS_pubpropertySystem_CAPS_staticMenuBar

Gets a Pen that is the color of the background of a menu bar.

System_CAPS_pubpropertySystem_CAPS_staticMenuHighlight

Gets a Pen that is the color used to highlight menu items when the menu appears as a flat menu.

System_CAPS_pubpropertySystem_CAPS_staticMenuText

Gets a Pen that is the color of a menu's text.

System_CAPS_pubpropertySystem_CAPS_staticScrollBar

Gets a Pen that is the color of the background of a scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticWindow

Gets a Pen that is the color of the background in the client area of a window.

System_CAPS_pubpropertySystem_CAPS_staticWindowFrame

Gets a Pen that is the color of a window frame.

System_CAPS_pubpropertySystem_CAPS_staticWindowText

Gets a Pen that is the color of the text in the client area of a window.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticFromSystemColor(Color)

Creates a Pen from the specified Color.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

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.

private void CreatePointsAndSizes(PaintEventArgs e)
{

    // Create the starting point.
    Point startPoint = new Point(subtractButton.Size);

    // Use the addition operator to get the end point.
    Point endPoint = startPoint + new 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.  
    Size buttonSize = (Size)startPoint;
    if (buttonSize == subtractButton.Size)

        // If the sizes are equal, tell the user.
    {
        e.Graphics.DrawString("The sizes are equal.", 
            new Font(this.Font, FontStyle.Italic), 
            Brushes.Indigo, 10.0F, 65.0F);
    }

}

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft