This topic has not yet been rated - Rate this topic

Pens Class

Pens for all the standard colors. This class cannot be inherited.

System.Object
  System.Drawing.Pens

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)
public sealed class Pens

The Pens type exposes the following members.

  Name Description
Public property Static member AliceBlue A system-defined Pen object with a width of 1.
Public property Static member AntiqueWhite A system-defined Pen object with a width of 1.
Public property Static member Aqua A system-defined Pen object with a width of 1.
Public property Static member Aquamarine A system-defined Pen object with a width of 1.
Public property Static member Azure A system-defined Pen object with a width of 1.
Public property Static member Beige A system-defined Pen object with a width of 1.
Public property Static member Bisque A system-defined Pen object with a width of 1.
Public property Static member Black A system-defined Pen object with a width of 1.
Public property Static member BlanchedAlmond A system-defined Pen object with a width of 1.
Public property Static member Blue A system-defined Pen object with a width of 1.
Public property Static member BlueViolet A system-defined Pen object with a width of 1.
Public property Static member Brown A system-defined Pen object with a width of 1.
Public property Static member BurlyWood A system-defined Pen object with a width of 1.
Public property Static member CadetBlue A system-defined Pen object with a width of 1.
Public property Static member Chartreuse A system-defined Pen object with a width of 1.
Public property Static member Chocolate A system-defined Pen object with a width of 1.
Public property Static member Coral A system-defined Pen object with a width of 1.
Public property Static member CornflowerBlue A system-defined Pen object with a width of 1.
Public property Static member Cornsilk A system-defined Pen object with a width of 1.
Public property Static member Crimson A system-defined Pen object with a width of 1.
Public property Static member Cyan A system-defined Pen object with a width of 1.
Public property Static member DarkBlue A system-defined Pen object with a width of 1.
Public property Static member DarkCyan A system-defined Pen object with a width of 1.
Public property Static member DarkGoldenrod A system-defined Pen object with a width of 1.
Public property Static member DarkGray A system-defined Pen object with a width of 1.
Public property Static member DarkGreen A system-defined Pen object with a width of 1.
Public property Static member DarkKhaki A system-defined Pen object with a width of 1.
Public property Static member DarkMagenta A system-defined Pen object with a width of 1.
Public property Static member DarkOliveGreen A system-defined Pen object with a width of 1.
Public property Static member DarkOrange A system-defined Pen object with a width of 1.
Public property Static member DarkOrchid A system-defined Pen object with a width of 1.
Public property Static member DarkRed A system-defined Pen object with a width of 1.
Public property Static member DarkSalmon A system-defined Pen object with a width of 1.
Public property Static member DarkSeaGreen A system-defined Pen object with a width of 1.
Public property Static member DarkSlateBlue A system-defined Pen object with a width of 1.
Public property Static member DarkSlateGray A system-defined Pen object with a width of 1.
Public property Static member DarkTurquoise A system-defined Pen object with a width of 1.
Public property Static member DarkViolet A system-defined Pen object with a width of 1.
Public property Static member DeepPink A system-defined Pen object with a width of 1.
Public property Static member DeepSkyBlue A system-defined Pen object with a width of 1.
Public property Static member DimGray A system-defined Pen object with a width of 1.
Public property Static member DodgerBlue A system-defined Pen object with a width of 1.
Public property Static member Firebrick A system-defined Pen object with a width of 1.
Public property Static member FloralWhite A system-defined Pen object with a width of 1.
Public property Static member ForestGreen A system-defined Pen object with a width of 1.
Public property Static member Fuchsia A system-defined Pen object with a width of 1.
Public property Static member Gainsboro A system-defined Pen object with a width of 1.
Public property Static member GhostWhite A system-defined Pen object with a width of 1.
Public property Static member Gold A system-defined Pen object with a width of 1.
Public property Static member Goldenrod A system-defined Pen object with a width of 1.
Public property Static member Gray A system-defined Pen object with a width of 1.
Public property Static member Green A system-defined Pen object with a width of 1.
Public property Static member GreenYellow A system-defined Pen object with a width of 1.
Public property Static member Honeydew A system-defined Pen object with a width of 1.
Public property Static member HotPink A system-defined Pen object with a width of 1.
Public property Static member IndianRed A system-defined Pen object with a width of 1.
Public property Static member Indigo A system-defined Pen object with a width of 1.
Public property Static member Ivory A system-defined Pen object with a width of 1.
Public property Static member Khaki A system-defined Pen object with a width of 1.
Public property Static member Lavender A system-defined Pen object with a width of 1.
Public property Static member LavenderBlush A system-defined Pen object with a width of 1.
Public property Static member LawnGreen A system-defined Pen object with a width of 1.
Public property Static member LemonChiffon A system-defined Pen object with a width of 1.
Public property Static member LightBlue A system-defined Pen object with a width of 1.
Public property Static member LightCoral A system-defined Pen object with a width of 1.
Public property Static member LightCyan A system-defined Pen object with a width of 1.
Public property Static member LightGoldenrodYellow A system-defined Pen object with a width of 1.
Public property Static member LightGray A system-defined Pen object with a width of 1.
Public property Static member LightGreen A system-defined Pen object with a width of 1.
Public property Static member LightPink A system-defined Pen object with a width of 1.
Public property Static member LightSalmon A system-defined Pen object with a width of 1.
Public property Static member LightSeaGreen A system-defined Pen object with a width of 1.
Public property Static member LightSkyBlue A system-defined Pen object with a width of 1.
Public property Static member LightSlateGray A system-defined Pen object with a width of 1.
Public property Static member LightSteelBlue A system-defined Pen object with a width of 1.
Public property Static member LightYellow A system-defined Pen object with a width of 1.
Public property Static member Lime A system-defined Pen object with a width of 1.
Public property Static member LimeGreen A system-defined Pen object with a width of 1.
Public property Static member Linen A system-defined Pen object with a width of 1.
Public property Static member Magenta A system-defined Pen object with a width of 1.
Public property Static member Maroon A system-defined Pen object with a width of 1.
Public property Static member MediumAquamarine A system-defined Pen object with a width of 1.
Public property Static member MediumBlue A system-defined Pen object with a width of 1.
Public property Static member MediumOrchid A system-defined Pen object with a width of 1.
Public property Static member MediumPurple A system-defined Pen object with a width of 1.
Public property Static member MediumSeaGreen A system-defined Pen object with a width of 1.
Public property Static member MediumSlateBlue A system-defined Pen object with a width of 1.
Public property Static member MediumSpringGreen A system-defined Pen object with a width of 1.
Public property Static member MediumTurquoise A system-defined Pen object with a width of 1.
Public property Static member MediumVioletRed A system-defined Pen object with a width of 1.
Public property Static member MidnightBlue A system-defined Pen object with a width of 1.
Public property Static member MintCream A system-defined Pen object with a width of 1.
Public property Static member MistyRose A system-defined Pen object with a width of 1.
Public property Static member Moccasin A system-defined Pen object with a width of 1.
Public property Static member NavajoWhite A system-defined Pen object with a width of 1.
Public property Static member Navy A system-defined Pen object with a width of 1.
Public property Static member OldLace A system-defined Pen object with a width of 1.
Public property Static member Olive A system-defined Pen object with a width of 1.
Public property Static member OliveDrab A system-defined Pen object with a width of 1.
Public property Static member Orange A system-defined Pen object with a width of 1.
Public property Static member OrangeRed A system-defined Pen object with a width of 1.
Public property Static member Orchid A system-defined Pen object with a width of 1.
Public property Static member PaleGoldenrod A system-defined Pen object with a width of 1.
Public property Static member PaleGreen A system-defined Pen object with a width of 1.
Public property Static member PaleTurquoise A system-defined Pen object with a width of 1.
Public property Static member PaleVioletRed A system-defined Pen object with a width of 1.
Public property Static member PapayaWhip A system-defined Pen object with a width of 1.
Public property Static member PeachPuff A system-defined Pen object with a width of 1.
Public property Static member Peru A system-defined Pen object with a width of 1.
Public property Static member Pink A system-defined Pen object with a width of 1.
Public property Static member Plum A system-defined Pen object with a width of 1.
Public property Static member PowderBlue A system-defined Pen object with a width of 1.
Public property Static member Purple A system-defined Pen object with a width of 1.
Public property Static member Red A system-defined Pen object with a width of 1.
Public property Static member RosyBrown A system-defined Pen object with a width of 1.
Public property Static member RoyalBlue A system-defined Pen object with a width of 1.
Public property Static member SaddleBrown A system-defined Pen object with a width of 1.
Public property Static member Salmon A system-defined Pen object with a width of 1.
Public property Static member SandyBrown A system-defined Pen object with a width of 1.
Public property Static member SeaGreen A system-defined Pen object with a width of 1.
Public property Static member SeaShell A system-defined Pen object with a width of 1.
Public property Static member Sienna A system-defined Pen object with a width of 1.
Public property Static member Silver A system-defined Pen object with a width of 1.
Public property Static member SkyBlue A system-defined Pen object with a width of 1.
Public property Static member SlateBlue A system-defined Pen object with a width of 1.
Public property Static member SlateGray A system-defined Pen object with a width of 1.
Public property Static member Snow A system-defined Pen object with a width of 1.
Public property Static member SpringGreen A system-defined Pen object with a width of 1.
Public property Static member SteelBlue A system-defined Pen object with a width of 1.
Public property Static member Tan A system-defined Pen object with a width of 1.
Public property Static member Teal A system-defined Pen object with a width of 1.
Public property Static member Thistle A system-defined Pen object with a width of 1.
Public property Static member Tomato A system-defined Pen object with a width of 1.
Public property Static member Transparent A system-defined Pen object with a width of 1.
Public property Static member Turquoise A system-defined Pen object with a width of 1.
Public property Static member Violet A system-defined Pen object with a width of 1.
Public property Static member Wheat A system-defined Pen object with a width of 1.
Public property Static member White A system-defined Pen object with a width of 1.
Public property Static member WhiteSmoke A system-defined Pen object with a width of 1.
Public property Static member Yellow A system-defined Pen object with a width of 1.
Public property Static member YellowGreen A system-defined Pen object with a width of 1.
Top
  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top

The Pen objects returned by this class are immutable, meaning their properties cannot be changed. To see the colors represented by pens in this class, see Colors by Name.

The following method demonstrates how to use the Pens class. This example is designed to be used with Windows Forms. Paste the code into a form and call the UsePensClass method when handling the form's Paint event, passing e as PaintEventArgs.


private void UsePensClass(PaintEventArgs e)
{
    e.Graphics.DrawEllipse(Pens.SlateBlue, 
        new Rectangle(40, 40, 140, 140));
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ