ControlPaint.DrawMenuGlyph 方法

定義

在功能表項目控制項上,繪製功能表圖像。

多載

DrawMenuGlyph(Graphics, Rectangle, MenuGlyph)

在指定的範圍和指定的表層中,在功能表項目控制項上繪製指定的功能表圖像。

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

在指定的範圍和指定的介面上,於功能表項目控制項上繪製指定的功能表圖像,並使用 backColor 參數中指定的色彩取代 White 而使用 foreColor 參數中指定的色彩取代 Black

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

在指定的範圍和指定的表層中,在功能表項目控制項上繪製指定的功能表圖像。

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

在指定的座標、高度和寬度以及指定的介面上,於功能表項目控制項上繪製指定的功能表圖像,並使用 backColor 參數中指定的色彩取代 White 而使用 foreColor 參數中指定的色彩取代 Black

DrawMenuGlyph(Graphics, Rectangle, MenuGlyph)

在指定的範圍和指定的表層中,在功能表項目控制項上繪製指定的功能表圖像。

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
Public Shared Sub DrawMenuGlyph (graphics As Graphics, rectangle As Rectangle, glyph As MenuGlyph)

參數

graphics
Graphics

要在上面繪製的 Graphics

rectangle
Rectangle

Rectangle,表示圖像的大小。

glyph
MenuGlyph

其中一個 MenuGlyph 值,指定要繪製的影像。

備註

當擁有者繪圖 MenuItem 控制項時,您必須驗證屬性值,以判斷要繪製或移除的正確圖像。 例如,當 屬性設定為 時 MenuItem.Checked ,您必須呼叫 Checkmark 的值 MenuGlyph ,在 上 MenuItem 繪製複選 true 標記。

另請參閱

適用於

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

在指定的範圍和指定的介面上,於功能表項目控制項上繪製指定的功能表圖像,並使用 backColor 參數中指定的色彩取代 White 而使用 foreColor 參數中指定的色彩取代 Black

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
Public Shared Sub DrawMenuGlyph (graphics As Graphics, rectangle As Rectangle, glyph As MenuGlyph, foreColor As Color, backColor As Color)

參數

graphics
Graphics

要在上面繪製的 Graphics

rectangle
Rectangle

Rectangle,表示圖像的大小。

glyph
MenuGlyph

其中一個 MenuGlyph 值,指定要繪製的影像。

foreColor
Color

取代 White 成為前景色彩的色彩。

backColor
Color

取代 Black 成為背景色彩的色彩。

備註

當擁有者繪圖 MenuItem 控制項時,您必須驗證屬性值,以判斷要繪製或移除的正確圖像。 例如,當 屬性設定為 時 MenuItem.Checked ,您必須呼叫 Checkmark 的值 MenuGlyph ,在 上 MenuItem 繪製複選 true 標記。

另請參閱

適用於

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

在指定的範圍和指定的表層中,在功能表項目控制項上繪製指定的功能表圖像。

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
Public Shared Sub DrawMenuGlyph (graphics As Graphics, x As Integer, y As Integer, width As Integer, height As Integer, glyph As MenuGlyph)

參數

graphics
Graphics

要在上面繪製的 Graphics

x
Int32

繪圖矩形左上角的 x 座標。

y
Int32

繪圖矩形左上角的 y 座標。

width
Int32

功能表圖像的寬度。

height
Int32

功能表圖像的高度。

glyph
MenuGlyph

其中一個 MenuGlyph 值,指定要繪製的影像。

備註

當擁有者繪圖 MenuItem 控制項時,您必須驗證屬性值,以判斷要繪製或移除的正確圖像。 例如,當 屬性設定為 true 時 MenuItem.Checked ,您會呼叫 Checkmark 的值 MenuGlyph ,在 上 MenuItem 繪製核取記號。

適用於

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

在指定的座標、高度和寬度以及指定的介面上,於功能表項目控制項上繪製指定的功能表圖像,並使用 backColor 參數中指定的色彩取代 White 而使用 foreColor 參數中指定的色彩取代 Black

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
Public Shared Sub DrawMenuGlyph (graphics As Graphics, x As Integer, y As Integer, width As Integer, height As Integer, glyph As MenuGlyph, foreColor As Color, backColor As Color)

參數

graphics
Graphics

要在上面繪製的 Graphics

x
Int32

繪圖矩形左上角的 x 座標。

y
Int32

繪圖矩形左上角的 y 座標。

width
Int32

功能表圖像的寬度。

height
Int32

功能表圖像的高度。

glyph
MenuGlyph

其中一個 MenuGlyph 值,指定要繪製的影像。

foreColor
Color

取代 White 成為前景色彩的色彩。

backColor
Color

取代 Black 成為背景色彩的色彩。

備註

當擁有者繪圖 MenuItem 控制項時,您必須驗證屬性值,以判斷要繪製或移除的正確圖像。 例如,當 屬性設定為 時 MenuItem.Checked ,您必須呼叫 Checkmark 的值 MenuGlyph ,在 上 MenuItem 繪製複選 true 標記。

另請參閱

適用於