KnownColor KnownColor KnownColor KnownColor Enum

定义

指定已知的系统颜色。Specifies the known system colors.

public enum class KnownColor
public enum KnownColor
type KnownColor = 
Public Enum KnownColor
继承

字段

ActiveBorder ActiveBorder ActiveBorder ActiveBorder 1

活动窗口边框的系统定义颜色。The system-defined color of the active window's border.

ActiveCaption ActiveCaption ActiveCaption ActiveCaption 2

活动窗口标题栏背景的系统定义颜色。The system-defined color of the background of the active window's title bar.

ActiveCaptionText ActiveCaptionText ActiveCaptionText ActiveCaptionText 3

活动窗口标题栏中文本的系统定义颜色。The system-defined color of the text in the active window's title bar.

AliceBlue AliceBlue AliceBlue AliceBlue 28

系统定义的颜色。A system-defined color.

AntiqueWhite AntiqueWhite AntiqueWhite AntiqueWhite 29

系统定义的颜色。A system-defined color.

AppWorkspace AppWorkspace AppWorkspace AppWorkspace 4

应用程序工作区的系统定义颜色。The system-defined color of the application workspace. 应用程序工作区是多文档视图中未被文档占据的区域。The application workspace is the area in a multiple-document view that is not being occupied by documents.

Aqua Aqua Aqua Aqua 30

系统定义的颜色。A system-defined color.

Aquamarine Aquamarine Aquamarine Aquamarine 31

系统定义的颜色。A system-defined color.

Azure Azure Azure Azure 32

系统定义的颜色。A system-defined color.

Beige Beige Beige Beige 33

系统定义的颜色。A system-defined color.

Bisque Bisque Bisque Bisque 34

系统定义的颜色。A system-defined color.

Black Black Black Black 35

系统定义的颜色。A system-defined color.

BlanchedAlmond BlanchedAlmond BlanchedAlmond BlanchedAlmond 36

系统定义的颜色。A system-defined color.

Blue Blue Blue Blue 37

系统定义的颜色。A system-defined color.

BlueViolet BlueViolet BlueViolet BlueViolet 38

系统定义的颜色。A system-defined color.

Brown Brown Brown Brown 39

系统定义的颜色。A system-defined color.

BurlyWood BurlyWood BurlyWood BurlyWood 40

系统定义的颜色。A system-defined color.

ButtonFace ButtonFace ButtonFace ButtonFace 168

三维元素的系统定义表面颜色。The system-defined face color of a 3-D element.

ButtonHighlight ButtonHighlight ButtonHighlight ButtonHighlight 169

系统定义的颜色,是三维元素的高光点颜色。The system-defined color that is the highlight color of a 3-D element. 此颜色应用于三维元素面向光源的部分。This color is applied to parts of a 3-D element that face the light source.

ButtonShadow ButtonShadow ButtonShadow ButtonShadow 170

系统定义的颜色,是三维元素的阴影颜色。The system-defined color that is the shadow color of a 3-D element. 此颜色应用于三维元素背向光源的部分。This color is applied to parts of a 3-D element that face away from the light source.

CadetBlue CadetBlue CadetBlue CadetBlue 41

系统定义的颜色。A system-defined color.

Chartreuse Chartreuse Chartreuse Chartreuse 42

系统定义的颜色。A system-defined color.

Chocolate Chocolate Chocolate Chocolate 43

系统定义的颜色。A system-defined color.

Control Control Control Control 5

三维元素的系统定义表面颜色。The system-defined face color of a 3-D element.

ControlDark ControlDark ControlDark ControlDark 6

三维元素的系统定义阴影颜色。The system-defined shadow color of a 3-D element. 阴影颜色应用于三维元素背向光源的部分。The shadow color is applied to parts of a 3-D element that face away from the light source.

ControlDarkDark ControlDarkDark ControlDarkDark ControlDarkDark 7

系统定义的颜色,是三维元素的暗阴影颜色。The system-defined color that is the dark shadow color of a 3-D element. 暗阴影颜色应用于三维元素颜色最深的部分。The dark shadow color is applied to the parts of a 3-D element that are the darkest color.

ControlLight ControlLight ControlLight ControlLight 8

系统定义的颜色,是三维元素的亮色。The system-defined color that is the light color of a 3-D element. 亮色应用于三维元素面向光源的部分。The light color is applied to parts of a 3-D element that face the light source.

ControlLightLight ControlLightLight ControlLightLight ControlLightLight 9

三维元素的系统定义高光点颜色。The system-defined highlight color of a 3-D element. 高光点颜色应用于三维元素的颜色最亮的部分。The highlight color is applied to the parts of a 3-D element that are the lightest color.

ControlText ControlText ControlText ControlText 10

三维元素中文本的系统定义颜色。The system-defined color of text in a 3-D element.

Coral Coral Coral Coral 44

系统定义的颜色。A system-defined color.

CornflowerBlue CornflowerBlue CornflowerBlue CornflowerBlue 45

系统定义的颜色。A system-defined color.

Cornsilk Cornsilk Cornsilk Cornsilk 46

系统定义的颜色。A system-defined color.

Crimson Crimson Crimson Crimson 47

系统定义的颜色。A system-defined color.

Cyan Cyan Cyan Cyan 48

系统定义的颜色。A system-defined color.

DarkBlue DarkBlue DarkBlue DarkBlue 49

系统定义的颜色。A system-defined color.

DarkCyan DarkCyan DarkCyan DarkCyan 50

系统定义的颜色。A system-defined color.

DarkGoldenrod DarkGoldenrod DarkGoldenrod DarkGoldenrod 51

系统定义的颜色。A system-defined color.

DarkGray DarkGray DarkGray DarkGray 52

系统定义的颜色。A system-defined color.

DarkGreen DarkGreen DarkGreen DarkGreen 53

系统定义的颜色。A system-defined color.

DarkKhaki DarkKhaki DarkKhaki DarkKhaki 54

系统定义的颜色。A system-defined color.

DarkMagenta DarkMagenta DarkMagenta DarkMagenta 55

系统定义的颜色。A system-defined color.

DarkOliveGreen DarkOliveGreen DarkOliveGreen DarkOliveGreen 56

系统定义的颜色。A system-defined color.

DarkOrange DarkOrange DarkOrange DarkOrange 57

系统定义的颜色。A system-defined color.

DarkOrchid DarkOrchid DarkOrchid DarkOrchid 58

系统定义的颜色。A system-defined color.

DarkRed DarkRed DarkRed DarkRed 59

系统定义的颜色。A system-defined color.

DarkSalmon DarkSalmon DarkSalmon DarkSalmon 60

系统定义的颜色。A system-defined color.

DarkSeaGreen DarkSeaGreen DarkSeaGreen DarkSeaGreen 61

系统定义的颜色。A system-defined color.

DarkSlateBlue DarkSlateBlue DarkSlateBlue DarkSlateBlue 62

系统定义的颜色。A system-defined color.

DarkSlateGray DarkSlateGray DarkSlateGray DarkSlateGray 63

系统定义的颜色。A system-defined color.

DarkTurquoise DarkTurquoise DarkTurquoise DarkTurquoise 64

系统定义的颜色。A system-defined color.

DarkViolet DarkViolet DarkViolet DarkViolet 65

系统定义的颜色。A system-defined color.

DeepPink DeepPink DeepPink DeepPink 66

系统定义的颜色。A system-defined color.

DeepSkyBlue DeepSkyBlue DeepSkyBlue DeepSkyBlue 67

系统定义的颜色。A system-defined color.

Desktop Desktop Desktop Desktop 11

桌面的系统定义颜色。The system-defined color of the desktop.

DimGray DimGray DimGray DimGray 68

系统定义的颜色。A system-defined color.

DodgerBlue DodgerBlue DodgerBlue DodgerBlue 69

系统定义的颜色。A system-defined color.

Firebrick Firebrick Firebrick Firebrick 70

系统定义的颜色。A system-defined color.

FloralWhite FloralWhite FloralWhite FloralWhite 71

系统定义的颜色。A system-defined color.

ForestGreen ForestGreen ForestGreen ForestGreen 72

系统定义的颜色。A system-defined color.

Fuchsia Fuchsia Fuchsia Fuchsia 73

系统定义的颜色。A system-defined color.

Gainsboro Gainsboro Gainsboro Gainsboro 74

系统定义的颜色。A system-defined color.

GhostWhite GhostWhite GhostWhite GhostWhite 75

系统定义的颜色。A system-defined color.

Gold Gold Gold Gold 76

系统定义的颜色。A system-defined color.

Goldenrod Goldenrod Goldenrod Goldenrod 77

系统定义的颜色。A system-defined color.

GradientActiveCaption GradientActiveCaption GradientActiveCaption GradientActiveCaption 171

活动窗口标题栏的颜色渐变中最亮色的系统定义颜色。The system-defined color of the lightest color in the color gradient of an active window's title bar.

GradientInactiveCaption GradientInactiveCaption GradientInactiveCaption GradientInactiveCaption 172

非活动窗口标题栏的颜色渐变中最亮色的系统定义颜色。The system-defined color of the lightest color in the color gradient of an inactive window's title bar.

Gray Gray Gray Gray 78

系统定义的颜色。A system-defined color.

GrayText GrayText GrayText GrayText 12

浅灰色文本的系统定义颜色。The system-defined color of dimmed text. 列表中已禁用的项用浅灰色文本显示。Items in a list that are disabled are displayed in dimmed text.

Green Green Green Green 79

系统定义的颜色。A system-defined color.

GreenYellow GreenYellow GreenYellow GreenYellow 80

系统定义的颜色。A system-defined color.

Highlight Highlight Highlight Highlight 13

选定项背景的系统定义颜色。The system-defined color of the background of selected items. 选定项包括选定菜单项和选定文本。This includes selected menu items as well as selected text.

HighlightText HighlightText HighlightText HighlightText 14

选定项文本的系统定义颜色。The system-defined color of the text of selected items.

Honeydew Honeydew Honeydew Honeydew 81

系统定义的颜色。A system-defined color.

HotPink HotPink HotPink HotPink 82

系统定义的颜色。A system-defined color.

HotTrack HotTrack HotTrack HotTrack 15

用于指定热跟踪项的系统定义颜色。The system-defined color used to designate a hot-tracked item. 单击一个热跟踪项会执行该项。Single-clicking a hot-tracked item executes the item.

InactiveBorder InactiveBorder InactiveBorder InactiveBorder 16

非活动窗口边框的系统定义颜色。The system-defined color of an inactive window's border.

InactiveCaption InactiveCaption InactiveCaption InactiveCaption 17

非活动窗口标题栏背景的系统定义颜色。The system-defined color of the background of an inactive window's title bar.

InactiveCaptionText InactiveCaptionText InactiveCaptionText InactiveCaptionText 18

非活动窗口标题栏文本的系统定义颜色。The system-defined color of the text in an inactive window's title bar.

IndianRed IndianRed IndianRed IndianRed 83

系统定义的颜色。A system-defined color.

Indigo Indigo Indigo Indigo 84

系统定义的颜色。A system-defined color.

Info Info Info Info 19

工具提示背景的系统定义颜色。The system-defined color of the background of a ToolTip.

InfoText InfoText InfoText InfoText 20

工具提示文本的系统定义颜色。The system-defined color of the text of a ToolTip.

Ivory Ivory Ivory Ivory 85

系统定义的颜色。A system-defined color.

Khaki Khaki Khaki Khaki 86

系统定义的颜色。A system-defined color.

Lavender Lavender Lavender Lavender 87

系统定义的颜色。A system-defined color.

LavenderBlush LavenderBlush LavenderBlush LavenderBlush 88

系统定义的颜色。A system-defined color.

LawnGreen LawnGreen LawnGreen LawnGreen 89

系统定义的颜色。A system-defined color.

LemonChiffon LemonChiffon LemonChiffon LemonChiffon 90

系统定义的颜色。A system-defined color.

LightBlue LightBlue LightBlue LightBlue 91

系统定义的颜色。A system-defined color.

LightCoral LightCoral LightCoral LightCoral 92

系统定义的颜色。A system-defined color.

LightCyan LightCyan LightCyan LightCyan 93

系统定义的颜色。A system-defined color.

LightGoldenrodYellow LightGoldenrodYellow LightGoldenrodYellow LightGoldenrodYellow 94

系统定义的颜色。A system-defined color.

LightGray LightGray LightGray LightGray 95

系统定义的颜色。A system-defined color.

LightGreen LightGreen LightGreen LightGreen 96

系统定义的颜色。A system-defined color.

LightPink LightPink LightPink LightPink 97

系统定义的颜色。A system-defined color.

LightSalmon LightSalmon LightSalmon LightSalmon 98

系统定义的颜色。A system-defined color.

LightSeaGreen LightSeaGreen LightSeaGreen LightSeaGreen 99

系统定义的颜色。A system-defined color.

LightSkyBlue LightSkyBlue LightSkyBlue LightSkyBlue 100

系统定义的颜色。A system-defined color.

LightSlateGray LightSlateGray LightSlateGray LightSlateGray 101

系统定义的颜色。A system-defined color.

LightSteelBlue LightSteelBlue LightSteelBlue LightSteelBlue 102

系统定义的颜色。A system-defined color.

LightYellow LightYellow LightYellow LightYellow 103

系统定义的颜色。A system-defined color.

Lime Lime Lime Lime 104

系统定义的颜色。A system-defined color.

LimeGreen LimeGreen LimeGreen LimeGreen 105

系统定义的颜色。A system-defined color.

Linen Linen Linen Linen 106

系统定义的颜色。A system-defined color.

Magenta Magenta Magenta Magenta 107

系统定义的颜色。A system-defined color.

Maroon Maroon Maroon Maroon 108

系统定义的颜色。A system-defined color.

MediumAquamarine MediumAquamarine MediumAquamarine MediumAquamarine 109

系统定义的颜色。A system-defined color.

MediumBlue MediumBlue MediumBlue MediumBlue 110

系统定义的颜色。A system-defined color.

MediumOrchid MediumOrchid MediumOrchid MediumOrchid 111

系统定义的颜色。A system-defined color.

MediumPurple MediumPurple MediumPurple MediumPurple 112

系统定义的颜色。A system-defined color.

MediumSeaGreen MediumSeaGreen MediumSeaGreen MediumSeaGreen 113

系统定义的颜色。A system-defined color.

MediumSlateBlue MediumSlateBlue MediumSlateBlue MediumSlateBlue 114

系统定义的颜色。A system-defined color.

MediumSpringGreen MediumSpringGreen MediumSpringGreen MediumSpringGreen 115

系统定义的颜色。A system-defined color.

MediumTurquoise MediumTurquoise MediumTurquoise MediumTurquoise 116

系统定义的颜色。A system-defined color.

MediumVioletRed MediumVioletRed MediumVioletRed MediumVioletRed 117

系统定义的颜色。A system-defined color.

Menu Menu Menu Menu 21

菜单背景的系统定义颜色。The system-defined color of a menu's background.

MenuBar MenuBar MenuBar MenuBar 173

菜单栏背景的系统定义颜色。The system-defined color of the background of a menu bar.

MenuHighlight MenuHighlight MenuHighlight MenuHighlight 174

当出现的是展开菜单时,用于突出显示菜单项的系统定义颜色。The system-defined color used to highlight menu items when the menu appears as a flat menu.

MenuText MenuText MenuText MenuText 22

菜单文本的系统定义颜色。The system-defined color of a menu's text.

MidnightBlue MidnightBlue MidnightBlue MidnightBlue 118

系统定义的颜色。A system-defined color.

MintCream MintCream MintCream MintCream 119

系统定义的颜色。A system-defined color.

MistyRose MistyRose MistyRose MistyRose 120

系统定义的颜色。A system-defined color.

Moccasin Moccasin Moccasin Moccasin 121

系统定义的颜色。A system-defined color.

NavajoWhite NavajoWhite NavajoWhite NavajoWhite 122

系统定义的颜色。A system-defined color.

Navy Navy Navy Navy 123

系统定义的颜色。A system-defined color.

OldLace OldLace OldLace OldLace 124

系统定义的颜色。A system-defined color.

Olive Olive Olive Olive 125

系统定义的颜色。A system-defined color.

OliveDrab OliveDrab OliveDrab OliveDrab 126

系统定义的颜色。A system-defined color.

Orange Orange Orange Orange 127

系统定义的颜色。A system-defined color.

OrangeRed OrangeRed OrangeRed OrangeRed 128

系统定义的颜色。A system-defined color.

Orchid Orchid Orchid Orchid 129

系统定义的颜色。A system-defined color.

PaleGoldenrod PaleGoldenrod PaleGoldenrod PaleGoldenrod 130

系统定义的颜色。A system-defined color.

PaleGreen PaleGreen PaleGreen PaleGreen 131

系统定义的颜色。A system-defined color.

PaleTurquoise PaleTurquoise PaleTurquoise PaleTurquoise 132

系统定义的颜色。A system-defined color.

PaleVioletRed PaleVioletRed PaleVioletRed PaleVioletRed 133

系统定义的颜色。A system-defined color.

PapayaWhip PapayaWhip PapayaWhip PapayaWhip 134

系统定义的颜色。A system-defined color.

PeachPuff PeachPuff PeachPuff PeachPuff 135

系统定义的颜色。A system-defined color.

Peru Peru Peru Peru 136

系统定义的颜色。A system-defined color.

Pink Pink Pink Pink 137

系统定义的颜色。A system-defined color.

Plum Plum Plum Plum 138

系统定义的颜色。A system-defined color.

PowderBlue PowderBlue PowderBlue PowderBlue 139

系统定义的颜色。A system-defined color.

Purple Purple Purple Purple 140

系统定义的颜色。A system-defined color.

Red Red Red Red 141

系统定义的颜色。A system-defined color.

RosyBrown RosyBrown RosyBrown RosyBrown 142

系统定义的颜色。A system-defined color.

RoyalBlue RoyalBlue RoyalBlue RoyalBlue 143

系统定义的颜色。A system-defined color.

SaddleBrown SaddleBrown SaddleBrown SaddleBrown 144

系统定义的颜色。A system-defined color.

Salmon Salmon Salmon Salmon 145

系统定义的颜色。A system-defined color.

SandyBrown SandyBrown SandyBrown SandyBrown 146

系统定义的颜色。A system-defined color.

ScrollBar ScrollBar ScrollBar ScrollBar 23

滚动条背景的系统定义颜色。The system-defined color of the background of a scroll bar.

SeaGreen SeaGreen SeaGreen SeaGreen 147

系统定义的颜色。A system-defined color.

SeaShell SeaShell SeaShell SeaShell 148

系统定义的颜色。A system-defined color.

Sienna Sienna Sienna Sienna 149

系统定义的颜色。A system-defined color.

Silver Silver Silver Silver 150

系统定义的颜色。A system-defined color.

SkyBlue SkyBlue SkyBlue SkyBlue 151

系统定义的颜色。A system-defined color.

SlateBlue SlateBlue SlateBlue SlateBlue 152

系统定义的颜色。A system-defined color.

SlateGray SlateGray SlateGray SlateGray 153

系统定义的颜色。A system-defined color.

Snow Snow Snow Snow 154

系统定义的颜色。A system-defined color.

SpringGreen SpringGreen SpringGreen SpringGreen 155

系统定义的颜色。A system-defined color.

SteelBlue SteelBlue SteelBlue SteelBlue 156

系统定义的颜色。A system-defined color.

Tan Tan Tan Tan 157

系统定义的颜色。A system-defined color.

Teal Teal Teal Teal 158

系统定义的颜色。A system-defined color.

Thistle Thistle Thistle Thistle 159

系统定义的颜色。A system-defined color.

Tomato Tomato Tomato Tomato 160

系统定义的颜色。A system-defined color.

Transparent Transparent Transparent Transparent 27

系统定义的颜色。A system-defined color.

Turquoise Turquoise Turquoise Turquoise 161

系统定义的颜色。A system-defined color.

Violet Violet Violet Violet 162

系统定义的颜色。A system-defined color.

Wheat Wheat Wheat Wheat 163

系统定义的颜色。A system-defined color.

White White White White 164

系统定义的颜色。A system-defined color.

WhiteSmoke WhiteSmoke WhiteSmoke WhiteSmoke 165

系统定义的颜色。A system-defined color.

Window Window Window Window 24

窗口的工作区中背景的系统定义颜色。The system-defined color of the background in the client area of a window.

WindowFrame WindowFrame WindowFrame WindowFrame 25

窗口框架的系统定义颜色。The system-defined color of a window frame.

WindowText WindowText WindowText WindowText 26

窗口的工作区中文本的系统定义颜色。The system-defined color of the text in the client area of a window.

Yellow Yellow Yellow Yellow 166

系统定义的颜色。A system-defined color.

YellowGreen YellowGreen YellowGreen YellowGreen 167

系统定义的颜色。A system-defined color.

示例

下面的代码示例演示如何使用KnownColor枚举输出其所有值的名称和颜色。The following code example demonstrates how to use the KnownColor enumeration to print out the names and colors of all its values. 此示例旨在与 Windows 窗体一起使用。This example is designed to be used with Windows Forms. 创建窗体并将以下代码粘贴到其中。Create a form and paste the following code into it. 在窗体的Paint事件处理方法中调用e PaintEventArgs方法,并DisplayKnownColors将作为传递。Call the DisplayKnownColors method in the form's Paint event-handling method, passing e as PaintEventArgs.

private:
   void DisplayKnownColors( PaintEventArgs^ e )
   {
      this->Size = System::Drawing::Size( 650, 550 );

      // Get all the values from the KnownColor enumeration.
      System::Array^ colorsArray = Enum::GetValues( KnownColor::typeid );
      array<KnownColor>^allColors = gcnew array<KnownColor>(colorsArray->Length);
      Array::Copy( colorsArray, allColors, colorsArray->Length );

      // Loop through printing out the values' names in the colors 
      // they represent.
      float y = 0;
      float x = 10.0F;
      for ( int i = 0; i < allColors->Length; i++ )
      {
         // If x is a multiple of 30, start a new column.
         if ( i > 0 && i % 30 == 0 )
         {
            x += 105.0F;
            y = 15.0F;
         }
         else
         {
            // Otherwise, increment y by 15.
            y += 15.0F;
         }

         // Create a custom brush from the color and use it to draw
         // the brush's name.
         SolidBrush^ aBrush = gcnew SolidBrush( Color::FromName( allColors[ i ].ToString() ) );
         e->Graphics->DrawString( allColors[ i ].ToString(), this->Font, aBrush, x, y );

         // Dispose of the custom brush.
         delete aBrush;
      }
   }
private void DisplayKnownColors(PaintEventArgs e)
{
    this.Size = new Size(650, 550);
    
    // Get all the values from the KnownColor enumeration.
    System.Array colorsArray = Enum.GetValues(typeof(KnownColor));
    KnownColor[] allColors = new KnownColor[colorsArray.Length];

    Array.Copy(colorsArray, allColors, colorsArray.Length);

    // Loop through printing out the values' names in the colors 
    // they represent.
    float y = 0;
    float x = 10.0F;

    for(int i = 0; i < allColors.Length; i++)
    {

        // If x is a multiple of 30, start a new column.
        if (i > 0 && i % 30 == 0)
        {
            x += 105.0F;
            y = 15.0F;
        }
        else
        {
            // Otherwise, increment y by 15.
            y += 15.0F;
        }

        // Create a custom brush from the color and use it to draw
        // the brush's name.
        SolidBrush aBrush = 
            new SolidBrush(Color.FromName(allColors[i].ToString()));
        e.Graphics.DrawString(allColors[i].ToString(), 
            this.Font, aBrush, x, y);

        // Dispose of the custom brush.
        aBrush.Dispose();
    }

}
Private Sub DisplayKnownColors(ByVal e As PaintEventArgs)
    Me.Size = New Size(650, 550)
    Dim i As Integer

    ' Get all the values from the KnownColor enumeration.
    Dim colorsArray As System.Array = _
        [Enum].GetValues(GetType(KnownColor))
    Dim allColors(colorsArray.length) As KnownColor

    Array.Copy(colorsArray, allColors, colorsArray.Length)

    ' Loop through printing out the value's name in the colors 
    ' they represent.
    Dim y As Single
    Dim x As Single = 10.0F

    For i = 0 To allColors.Length - 1

        ' If x is a multiple of 30, start a new column.
        If (i > 0 And i Mod 30 = 0) Then
            x += 105.0F
            y = 15.0F
        Else
            ' Otherwise increment y by 15.
            y += 15.0F
        End If

        ' Create a custom brush from the color and use it to draw
        ' the brush's name.
        Dim aBrush As New SolidBrush(Color.FromName( _
            allColors(i).ToString()))
        e.Graphics.DrawString(allColors(i).ToString(), _
            Me.Font, aBrush, x, y)

        ' Dispose of the custom brush.
        aBrush.Dispose()
    Next

End Sub

适用于