ToolStripRenderEventArgs ToolStripRenderEventArgs ToolStripRenderEventArgs ToolStripRenderEventArgs Class

定义

public ref class ToolStripRenderEventArgs : EventArgs
public class ToolStripRenderEventArgs : EventArgs
type ToolStripRenderEventArgs = class
    inherit EventArgs
Public Class ToolStripRenderEventArgs
Inherits EventArgs
继承
ToolStripRenderEventArgsToolStripRenderEventArgsToolStripRenderEventArgsToolStripRenderEventArgs
派生

示例

下面的代码示例演示如何重写OnRenderToolStripBorder方法以自定义周围绘制边框ToolStrip控件。The following code example demonstrates how to override the OnRenderToolStripBorder method to draw a custom border around a ToolStrip control. 此代码示例是为提供一个更大示例的一部分ToolStripRenderer类。This code example is part of a larger example provided for the ToolStripRenderer class.

// This method draws a border around the GridStrip control.
protected override void OnRenderToolStripBorder(
    ToolStripRenderEventArgs e)
{
    base.OnRenderToolStripBorder(e);

    ControlPaint.DrawFocusRectangle(
        e.Graphics,
        e.AffectedBounds,
        SystemColors.ControlDarkDark,
        SystemColors.ControlDarkDark);
}
' This method draws a border around the GridStrip control.
Protected Overrides Sub OnRenderToolStripBorder(e As ToolStripRenderEventArgs)
   MyBase.OnRenderToolStripBorder(e)
   
   ControlPaint.DrawFocusRectangle(e.Graphics, e.AffectedBounds, SystemColors.ControlDarkDark, SystemColors.ControlDarkDark)
End Sub 

注解

ToolStripRenderEventArgs类还提供了数据DrawImageMarginDrawToolStripBorder,和DrawToolStripBackground方法。The ToolStripRenderEventArgs class also provides data for the DrawImageMargin, DrawToolStripBorder, and DrawToolStripBackground methods.

构造函数

ToolStripRenderEventArgs(Graphics, ToolStrip) ToolStripRenderEventArgs(Graphics, ToolStrip) ToolStripRenderEventArgs(Graphics, ToolStrip) ToolStripRenderEventArgs(Graphics, ToolStrip)

使用指定的 ToolStripRenderEventArgs 为指定的 ToolStrip 初始化 Graphics 的新实例。Initializes a new instance of the ToolStripRenderEventArgs class for the specified ToolStrip and using the specified Graphics.

ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color) ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color) ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color) ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color)

为指定 ToolStripRenderEventArgs 初始化 ToolStrip 类的新实例,并使用指定的 GraphicsColor 绘制指定的边界。Initializes a new instance of the ToolStripRenderEventArgs class for the specified ToolStrip, using the specified Graphics to paint the specified bounds with the specified Color.

属性

AffectedBounds AffectedBounds AffectedBounds AffectedBounds

获取表示待绘制区域的边界的 RectangleGets the Rectangle representing the bounds of the area to be painted.

BackColor BackColor BackColor BackColor

获取用来绘制 Color 的背景的 ToolStripGets the Color that the background of the ToolStrip is painted with.

ConnectedArea ConnectedArea ConnectedArea ConnectedArea

获取一个 Rectangle,表示 ToolStripDropDown 及其 OwnerItem 之间的重叠区域。Gets the Rectangle representing the overlap area between a ToolStripDropDown and its OwnerItem.

Graphics Graphics Graphics Graphics

获取用于绘制的 GraphicsGets the Graphics used to paint.

ToolStrip ToolStrip ToolStrip ToolStrip

获取要绘制的 ToolStripGets the ToolStrip to be painted.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅