ToolStripRenderer.DrawLabelBackground(ToolStripItemRenderEventArgs) 方法

定义

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

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

参数

e
ToolStripItemRenderEventArgs

一个 ToolStripItemRenderEventArgs,其中包含用于绘制标签背景的数据。A ToolStripItemRenderEventArgs that contains the data to draw the background for the label.

注解

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

适用于