ToolStripRenderer.DrawItemBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawItemBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawItemBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawItemBackground(ToolStripItemRenderEventArgs) Method

定义

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

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

参数

e
ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs

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

注解

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

适用于