ControlPaint.DrawMenuGlyph ControlPaint.DrawMenuGlyph ControlPaint.DrawMenuGlyph Method

定义

在菜单项控件上绘制菜单标志符号。Draws a menu glyph on a menu item control.

重载

DrawMenuGlyph(Graphics, Rectangle, MenuGlyph) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph)

在菜单项控件上指定的边界内、指定的表面上,绘制指定的菜单标志符号。Draws the specified menu glyph on a menu item control within the specified bounds and on the specified surface.

DrawMenuGlyph(Graphics, Rectangle, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph, Color, Color)

在菜单项控件上指定的边界内、指定的图面上绘制指定的菜单标志符号,用 backColor 参数中指定的颜色替换 White,并用 foreColor 参数中指定的颜色替换 BlackDraws the specified menu glyph on a menu item control within the specified bounds and on the specified surface, replacing White with the color specified in the backColor parameter and replacing Black with the color specified in the foreColor parameter.

DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph)

在菜单项控件上指定的边界内、指定的表面上,绘制指定的菜单标志符号。Draws the specified menu glyph on a menu item control with the specified bounds and on the specified surface.

DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph, Color, Color)

在菜单项控件上指定的图面上,以指定的坐标、高度和宽度绘制指定的菜单标志符号,用 backColor 参数中指定的颜色替换 White,并用 foreColor 参数中指定的颜色替换 BlackDraws the specified menu glyph on a menu item control within the specified coordinates, height, and width on the specified surface, replacing White with the color specified in the backColor parameter and replacing Black with the color specified in the foreColor parameter.

DrawMenuGlyph(Graphics, Rectangle, MenuGlyph) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph)

在菜单项控件上指定的边界内、指定的表面上,绘制指定的菜单标志符号。Draws the specified menu glyph on a menu item control within the specified bounds and on the specified surface.

public:
 static void DrawMenuGlyph(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Windows::Forms::MenuGlyph glyph);
public static void DrawMenuGlyph (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.MenuGlyph glyph);
static member DrawMenuGlyph : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.MenuGlyph -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

rectangle
Rectangle Rectangle Rectangle

代表标志符号尺寸的 RectangleThe Rectangle that represents the dimensions of the glyph.

glyph
MenuGlyph MenuGlyph MenuGlyph

MenuGlyph 值的其中之一,指定将要绘制的图像。One of the MenuGlyph values that specifies the image to draw.

注解

当所有者描述MenuItem控件,你需要验证属性值,以确定正确的标志符号,以绘制或删除。When owner-drawing MenuItem controls, you need to verify property values to determine the correct glyph to draw or remove. 例如,当MenuItem.Checked属性设置为true,则必须调用Checkmark的值MenuGlyph上绘制一个复选标记MenuItemFor example, when the MenuItem.Checked property is set to true, you must call the Checkmark value of MenuGlyph to draw a check mark on the MenuItem.

另请参阅

DrawMenuGlyph(Graphics, Rectangle, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Rectangle, MenuGlyph, Color, Color)

在菜单项控件上指定的边界内、指定的图面上绘制指定的菜单标志符号,用 backColor 参数中指定的颜色替换 White,并用 foreColor 参数中指定的颜色替换 BlackDraws the specified menu glyph on a menu item control within the specified bounds and on the specified surface, replacing White with the color specified in the backColor parameter and replacing Black with the color specified in the foreColor parameter.

public:
 static void DrawMenuGlyph(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Windows::Forms::MenuGlyph glyph, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawMenuGlyph (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.MenuGlyph glyph, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawMenuGlyph : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.MenuGlyph * System.Drawing.Color * System.Drawing.Color -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

rectangle
Rectangle Rectangle Rectangle

代表标志符号尺寸的 RectangleThe Rectangle that represents the dimensions of the glyph.

glyph
MenuGlyph MenuGlyph MenuGlyph

MenuGlyph 值的其中之一,指定将要绘制的图像。One of the MenuGlyph values that specifies the image to draw.

foreColor
Color Color Color

替换 White 作为前景色的颜色。The color that replaces White as the foreground color.

backColor
Color Color Color

替换 Black 作为背景色的颜色。The color that replaces Black as the background color.

注解

当所有者描述MenuItem控件,你需要验证属性值,以确定正确的标志符号,以绘制或删除。When owner-drawing MenuItem controls, you need to verify property values to determine the correct glyph to draw or remove. 例如,当MenuItem.Checked属性设置为true,则必须调用Checkmark的值MenuGlyph上绘制一个复选标记MenuItemFor example, when the MenuItem.Checked property is set to true, you must call the Checkmark value of MenuGlyph to draw a check mark on the MenuItem.

另请参阅

DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph)

在菜单项控件上指定的边界内、指定的表面上,绘制指定的菜单标志符号。Draws the specified menu glyph on a menu item control with the specified bounds and on the specified surface.

public:
 static void DrawMenuGlyph(System::Drawing::Graphics ^ graphics, int x, int y, int width, int height, System::Windows::Forms::MenuGlyph glyph);
public static void DrawMenuGlyph (System.Drawing.Graphics graphics, int x, int y, int width, int height, System.Windows.Forms.MenuGlyph glyph);
static member DrawMenuGlyph : System.Drawing.Graphics * int * int * int * int * System.Windows.Forms.MenuGlyph -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

x
Int32 Int32 Int32

所绘制矩形左上角的 x 坐标。The x-coordinate of the upper left corner of the drawing rectangle.

y
Int32 Int32 Int32

所绘制矩形左上角的 y 坐标。The y-coordinate of the upper left corner of the drawing rectangle.

width
Int32 Int32 Int32

菜单标志符号的宽度。The width of the menu glyph.

height
Int32 Int32 Int32

菜单标志符号的高度。The height of the menu glyph.

glyph
MenuGlyph MenuGlyph MenuGlyph

MenuGlyph 值的其中之一,指定将要绘制的图像。One of the MenuGlyph values that specifies the image to draw.

注解

当所有者描述MenuItem控件,你需要验证属性值,以确定正确的标志符号,以绘制或删除。When owner-drawing MenuItem controls, you need to verify property values to determine the correct glyph to draw or remove. 例如,当MenuItem.Checked属性设置为 true,则调用Checkmark的值MenuGlyph上绘制一个复选标记MenuItemFor example, when the MenuItem.Checked property is set to true, you call the Checkmark value of MenuGlyph to draw a check mark on the MenuItem.

DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph, Color, Color) DrawMenuGlyph(Graphics, Int32, Int32, Int32, Int32, MenuGlyph, Color, Color)

在菜单项控件上指定的图面上,以指定的坐标、高度和宽度绘制指定的菜单标志符号,用 backColor 参数中指定的颜色替换 White,并用 foreColor 参数中指定的颜色替换 BlackDraws the specified menu glyph on a menu item control within the specified coordinates, height, and width on the specified surface, replacing White with the color specified in the backColor parameter and replacing Black with the color specified in the foreColor parameter.

public:
 static void DrawMenuGlyph(System::Drawing::Graphics ^ graphics, int x, int y, int width, int height, System::Windows::Forms::MenuGlyph glyph, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawMenuGlyph (System.Drawing.Graphics graphics, int x, int y, int width, int height, System.Windows.Forms.MenuGlyph glyph, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawMenuGlyph : System.Drawing.Graphics * int * int * int * int * System.Windows.Forms.MenuGlyph * System.Drawing.Color * System.Drawing.Color -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

x
Int32 Int32 Int32

所绘制矩形左上角的 x 坐标。The x-coordinate of the upper left corner of the drawing rectangle.

y
Int32 Int32 Int32

所绘制矩形左上角的 y 坐标。The y-coordinate of the upper left corner of the drawing rectangle.

width
Int32 Int32 Int32

菜单标志符号的宽度。The width of the menu glyph.

height
Int32 Int32 Int32

菜单标志符号的高度。The height of the menu glyph.

glyph
MenuGlyph MenuGlyph MenuGlyph

MenuGlyph 值的其中之一,指定将要绘制的图像。One of the MenuGlyph values that specifies the image to draw.

foreColor
Color Color Color

替换 White 作为前景色的颜色。The color that replaces White as the foreground color.

backColor
Color Color Color

替换 Black 作为背景色的颜色。The color that replaces Black as the background color.

注解

当所有者描述MenuItem控件,你需要验证属性值,以确定正确的标志符号,以绘制或删除。When owner-drawing MenuItem controls, you need to verify property values to determine the correct glyph to draw or remove. 例如,当MenuItem.Checked属性设置为true,则必须调用Checkmark的值MenuGlyph上绘制一个复选标记MenuItemFor example, when the MenuItem.Checked property is set to true, you must call the Checkmark value of MenuGlyph to draw a check mark on the MenuItem.

另请参阅

适用于