ToolStripRenderer.DrawMenuItemBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawMenuItemBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawMenuItemBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawMenuItemBackground(ToolStripItemRenderEventArgs) Method

定义

绘制 ToolStripMenuItem 的背景。Draws the background for a ToolStripMenuItem.

public:
 void DrawMenuItemBackground(System::Windows::Forms::ToolStripItemRenderEventArgs ^ e);
public void DrawMenuItemBackground (System.Windows.Forms.ToolStripItemRenderEventArgs e);
member this.DrawMenuItemBackground : System.Windows.Forms.ToolStripItemRenderEventArgs -> unit
Public Sub DrawMenuItemBackground (e As ToolStripItemRenderEventArgs)

参数

e
ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs

一个 ToolStripItemRenderEventArgs,其中包含用于绘制菜单项背景的数据。A ToolStripItemRenderEventArgs that contains the data to draw the background for the menu item.

注解

方法为的背景ToolStripMenuItem提供呈现代码的入口点。 DrawMenuItemBackgroundThe DrawMenuItemBackground method provides the entry point to the rendering code for the background of a ToolStripMenuItem. 当重写ToolStripMenuItem ToolStripRenderer方法时, 使用此方法绘制的背景, 或强制在自定义中绘制的背景。 ToolStripMenuItem.OnPaint ToolStripMenuItemUse this method to draw the background of a ToolStripMenuItem when overriding the ToolStripMenuItem.OnPaint method, or to force the background of a ToolStripMenuItem to be drawn in a custom ToolStripRenderer. 若要更改呈现背景ToolStripMenuItem的方式, 请重写派生自OnRenderMenuItemBackground ToolStripRenderer的类中的方法。To change the way the background for a ToolStripMenuItem is rendered, override the OnRenderMenuItemBackground method in a class derived from ToolStripRenderer.

适用于