Export (0) Print
Expand All

ControlPaint.DrawMenuGlyph Method (Graphics, Int32, Int32, Int32, Int32, MenuGlyph, Color, Color)

Note: This method is new in the .NET Framework version 2.0.

Draws 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.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public static void DrawMenuGlyph (
	Graphics graphics,
	int x,
	int y,
	int width,
	int height,
	MenuGlyph glyph,
	Color foreColor,
	Color backColor
)
public static void DrawMenuGlyph (
	Graphics graphics, 
	int x, 
	int y, 
	int width, 
	int height, 
	MenuGlyph glyph, 
	Color foreColor, 
	Color backColor
)
public static function DrawMenuGlyph (
	graphics : Graphics, 
	x : int, 
	y : int, 
	width : int, 
	height : int, 
	glyph : MenuGlyph, 
	foreColor : Color, 
	backColor : Color
)

Parameters

graphics

The Graphics to draw on.

x

The x-coordinate of the upper left corner of the drawing rectangle.

y

The y-coordinate of the upper left corner of the drawing rectangle.

width

The width of the menu glyph.

height

The height of the menu glyph.

glyph

One of the MenuGlyph values that specifies the image to draw.

foreColor

The color that replaces White as the foreground color.

backColor

The color that replaces Black as the background color.

When owner-drawing MenuItem controls, you need to verify property values to determine the correct glyph to draw or remove. For 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.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2015 Microsoft