Export (0) Print
Expand All

Brushes Class

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

System.Object
  System.Drawing.Brushes

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

public sealed class Brushes

The Brushes type exposes the following members.

  NameDescription
Public propertyStatic memberAliceBlueGets a system-defined Brush object.
Public propertyStatic memberAntiqueWhiteGets a system-defined Brush object.
Public propertyStatic memberAquaGets a system-defined Brush object.
Public propertyStatic memberAquamarineGets a system-defined Brush object.
Public propertyStatic memberAzureGets a system-defined Brush object.
Public propertyStatic memberBeigeGets a system-defined Brush object.
Public propertyStatic memberBisqueGets a system-defined Brush object.
Public propertyStatic memberBlackGets a system-defined Brush object.
Public propertyStatic memberBlanchedAlmondGets a system-defined Brush object.
Public propertyStatic memberBlueGets a system-defined Brush object.
Public propertyStatic memberBlueVioletGets a system-defined Brush object.
Public propertyStatic memberBrownGets a system-defined Brush object.
Public propertyStatic memberBurlyWoodGets a system-defined Brush object.
Public propertyStatic memberCadetBlueGets a system-defined Brush object.
Public propertyStatic memberChartreuseGets a system-defined Brush object.
Public propertyStatic memberChocolateGets a system-defined Brush object.
Public propertyStatic memberCoralGets a system-defined Brush object.
Public propertyStatic memberCornflowerBlueGets a system-defined Brush object.
Public propertyStatic memberCornsilkGets a system-defined Brush object.
Public propertyStatic memberCrimsonGets a system-defined Brush object.
Public propertyStatic memberCyanGets a system-defined Brush object.
Public propertyStatic memberDarkBlueGets a system-defined Brush object.
Public propertyStatic memberDarkCyanGets a system-defined Brush object.
Public propertyStatic memberDarkGoldenrodGets a system-defined Brush object.
Public propertyStatic memberDarkGrayGets a system-defined Brush object.
Public propertyStatic memberDarkGreenGets a system-defined Brush object.
Public propertyStatic memberDarkKhakiGets a system-defined Brush object.
Public propertyStatic memberDarkMagentaGets a system-defined Brush object.
Public propertyStatic memberDarkOliveGreenGets a system-defined Brush object.
Public propertyStatic memberDarkOrangeGets a system-defined Brush object.
Public propertyStatic memberDarkOrchidGets a system-defined Brush object.
Public propertyStatic memberDarkRedGets a system-defined Brush object.
Public propertyStatic memberDarkSalmonGets a system-defined Brush object.
Public propertyStatic memberDarkSeaGreenGets a system-defined Brush object.
Public propertyStatic memberDarkSlateBlueGets a system-defined Brush object.
Public propertyStatic memberDarkSlateGrayGets a system-defined Brush object.
Public propertyStatic memberDarkTurquoiseGets a system-defined Brush object.
Public propertyStatic memberDarkVioletGets a system-defined Brush object.
Public propertyStatic memberDeepPinkGets a system-defined Brush object.
Public propertyStatic memberDeepSkyBlueGets a system-defined Brush object.
Public propertyStatic memberDimGrayGets a system-defined Brush object.
Public propertyStatic memberDodgerBlueGets a system-defined Brush object.
Public propertyStatic memberFirebrickGets a system-defined Brush object.
Public propertyStatic memberFloralWhiteGets a system-defined Brush object.
Public propertyStatic memberForestGreenGets a system-defined Brush object.
Public propertyStatic memberFuchsiaGets a system-defined Brush object.
Public propertyStatic memberGainsboroGets a system-defined Brush object.
Public propertyStatic memberGhostWhiteGets a system-defined Brush object.
Public propertyStatic memberGoldGets a system-defined Brush object.
Public propertyStatic memberGoldenrodGets a system-defined Brush object.
Public propertyStatic memberGrayGets a system-defined Brush object.
Public propertyStatic memberGreenGets a system-defined Brush object.
Public propertyStatic memberGreenYellowGets a system-defined Brush object.
Public propertyStatic memberHoneydewGets a system-defined Brush object.
Public propertyStatic memberHotPinkGets a system-defined Brush object.
Public propertyStatic memberIndianRedGets a system-defined Brush object.
Public propertyStatic memberIndigoGets a system-defined Brush object.
Public propertyStatic memberIvoryGets a system-defined Brush object.
Public propertyStatic memberKhakiGets a system-defined Brush object.
Public propertyStatic memberLavenderGets a system-defined Brush object.
Public propertyStatic memberLavenderBlushGets a system-defined Brush object.
Public propertyStatic memberLawnGreenGets a system-defined Brush object.
Public propertyStatic memberLemonChiffonGets a system-defined Brush object.
Public propertyStatic memberLightBlueGets a system-defined Brush object.
Public propertyStatic memberLightCoralGets a system-defined Brush object.
Public propertyStatic memberLightCyanGets a system-defined Brush object.
Public propertyStatic memberLightGoldenrodYellowGets a system-defined Brush object.
Public propertyStatic memberLightGrayGets a system-defined Brush object.
Public propertyStatic memberLightGreenGets a system-defined Brush object.
Public propertyStatic memberLightPinkGets a system-defined Brush object.
Public propertyStatic memberLightSalmonGets a system-defined Brush object.
Public propertyStatic memberLightSeaGreenGets a system-defined Brush object.
Public propertyStatic memberLightSkyBlueGets a system-defined Brush object.
Public propertyStatic memberLightSlateGrayGets a system-defined Brush object.
Public propertyStatic memberLightSteelBlueGets a system-defined Brush object.
Public propertyStatic memberLightYellowGets a system-defined Brush object.
Public propertyStatic memberLimeGets a system-defined Brush object.
Public propertyStatic memberLimeGreenGets a system-defined Brush object.
Public propertyStatic memberLinenGets a system-defined Brush object.
Public propertyStatic memberMagentaGets a system-defined Brush object.
Public propertyStatic memberMaroonGets a system-defined Brush object.
Public propertyStatic memberMediumAquamarineGets a system-defined Brush object.
Public propertyStatic memberMediumBlueGets a system-defined Brush object.
Public propertyStatic memberMediumOrchidGets a system-defined Brush object.
Public propertyStatic memberMediumPurpleGets a system-defined Brush object.
Public propertyStatic memberMediumSeaGreenGets a system-defined Brush object.
Public propertyStatic memberMediumSlateBlueGets a system-defined Brush object.
Public propertyStatic memberMediumSpringGreenGets a system-defined Brush object.
Public propertyStatic memberMediumTurquoiseGets a system-defined Brush object.
Public propertyStatic memberMediumVioletRedGets a system-defined Brush object.
Public propertyStatic memberMidnightBlueGets a system-defined Brush object.
Public propertyStatic memberMintCreamGets a system-defined Brush object.
Public propertyStatic memberMistyRoseGets a system-defined Brush object.
Public propertyStatic memberMoccasinGets a system-defined Brush object.
Public propertyStatic memberNavajoWhiteGets a system-defined Brush object.
Public propertyStatic memberNavyGets a system-defined Brush object.
Public propertyStatic memberOldLaceGets a system-defined Brush object.
Public propertyStatic memberOliveGets a system-defined Brush object.
Public propertyStatic memberOliveDrabGets a system-defined Brush object.
Public propertyStatic memberOrangeGets a system-defined Brush object.
Public propertyStatic memberOrangeRedGets a system-defined Brush object.
Public propertyStatic memberOrchidGets a system-defined Brush object.
Public propertyStatic memberPaleGoldenrodGets a system-defined Brush object.
Public propertyStatic memberPaleGreenGets a system-defined Brush object.
Public propertyStatic memberPaleTurquoiseGets a system-defined Brush object.
Public propertyStatic memberPaleVioletRedGets a system-defined Brush object.
Public propertyStatic memberPapayaWhipGets a system-defined Brush object.
Public propertyStatic memberPeachPuffGets a system-defined Brush object.
Public propertyStatic memberPeruGets a system-defined Brush object.
Public propertyStatic memberPinkGets a system-defined Brush object.
Public propertyStatic memberPlumGets a system-defined Brush object.
Public propertyStatic memberPowderBlueGets a system-defined Brush object.
Public propertyStatic memberPurpleGets a system-defined Brush object.
Public propertyStatic memberRedGets a system-defined Brush object.
Public propertyStatic memberRosyBrownGets a system-defined Brush object.
Public propertyStatic memberRoyalBlueGets a system-defined Brush object.
Public propertyStatic memberSaddleBrownGets a system-defined Brush object.
Public propertyStatic memberSalmonGets a system-defined Brush object.
Public propertyStatic memberSandyBrownGets a system-defined Brush object.
Public propertyStatic memberSeaGreenGets a system-defined Brush object.
Public propertyStatic memberSeaShellGets a system-defined Brush object.
Public propertyStatic memberSiennaGets a system-defined Brush object.
Public propertyStatic memberSilverGets a system-defined Brush object.
Public propertyStatic memberSkyBlueGets a system-defined Brush object.
Public propertyStatic memberSlateBlueGets a system-defined Brush object.
Public propertyStatic memberSlateGrayGets a system-defined Brush object.
Public propertyStatic memberSnowGets a system-defined Brush object.
Public propertyStatic memberSpringGreenGets a system-defined Brush object.
Public propertyStatic memberSteelBlueGets a system-defined Brush object.
Public propertyStatic memberTanGets a system-defined Brush object.
Public propertyStatic memberTealGets a system-defined Brush object.
Public propertyStatic memberThistleGets a system-defined Brush object.
Public propertyStatic memberTomatoGets a system-defined Brush object.
Public propertyStatic memberTransparentGets a system-defined Brush object.
Public propertyStatic memberTurquoiseGets a system-defined Brush object.
Public propertyStatic memberVioletGets a system-defined Brush object.
Public propertyStatic memberWheatGets a system-defined Brush object.
Public propertyStatic memberWhiteGets a system-defined Brush object.
Public propertyStatic memberWhiteSmokeGets a system-defined Brush object.
Public propertyStatic memberYellowGets a system-defined Brush object.
Public propertyStatic memberYellowGreenGets a system-defined Brush object.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The Brushes class contains static read-only properties that return a Brush object of the color indicated by the property name. You typically do not have to explicitly dispose of the brush returned by a property in this class, unless it is used to construct a new brush. For more information about the colors represented by the brushes in this class, see Colors by Name.

The following code example demonstrates the how to use a member of the Brushes class to fill a Rectangle. This example should be used with a Windows Form. Paste this code into a form and call this method when handling the form's Paint event, passing e as PaintEventArgs.

private void InstanceRectangleIntersection(PaintEventArgs e)
{

    Rectangle rectangle1 = new Rectangle(50, 50, 200, 100);
    Rectangle rectangle2 = new Rectangle(70, 20, 100, 200);

    e.Graphics.DrawRectangle(Pens.Black, rectangle1);
    e.Graphics.DrawRectangle(Pens.Red, rectangle2);

    if (rectangle1.IntersectsWith(rectangle2))
    {
        rectangle1.Intersect(rectangle2);
        if (!rectangle1.IsEmpty)
        {
            e.Graphics.FillRectangle(Brushes.Green, rectangle1);
        }
    }
}

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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.
Show:
© 2014 Microsoft