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. 若要變更專案的背景呈現方式, 請覆寫衍生自OnRenderItemBackgroundToolStripRenderer類別中的方法。To change the way the background of an item is rendered, override the OnRenderItemBackground method in a class derived from ToolStripRenderer.

適用於