ToolStripRenderer.DrawButtonBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawButtonBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawButtonBackground(ToolStripItemRenderEventArgs) ToolStripRenderer.DrawButtonBackground(ToolStripItemRenderEventArgs) Method

定义

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

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

参数

e
ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs ToolStripItemRenderEventArgs

一个 ToolStripItemRenderEventArgs,其中包含用于绘制按钮背景的数据。The ToolStripItemRenderEventArgs that contains data to draw the button's background.

注解

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

适用于