ToolStripGripRenderEventArgs 类

定义

RenderGrip 事件提供数据。Provides data for the RenderGrip event.

public ref class ToolStripGripRenderEventArgs : System::Windows::Forms::ToolStripRenderEventArgs
public class ToolStripGripRenderEventArgs : System.Windows.Forms.ToolStripRenderEventArgs
type ToolStripGripRenderEventArgs = class
    inherit ToolStripRenderEventArgs
Public Class ToolStripGripRenderEventArgs
Inherits ToolStripRenderEventArgs
继承
ToolStripGripRenderEventArgs

示例

下面的代码示例演示如何使用此类型。The following code example demonstrates the use of this type. 在此示例中,事件处理程序报告事件的发生 RenderGripIn the example, an event handler reports on the occurrence of the RenderGrip event. 此报表可帮助你了解何时发生事件,并可帮助你进行调试。This report helps you to learn when the event occurs and can assist you in debugging.

若要运行示例代码,请将其粘贴到一个项目中,该项目包含从继承的类型的实例 ToolStripRenderer ,如 ToolStripSystemRendererToolStripProfessionalRendererTo run the example code, paste it into a project that contains an instance of a type that inherits from ToolStripRenderer, such as a ToolStripSystemRenderer or ToolStripProfessionalRenderer. 然后命名该实例 ToolStripRenderer1 ,并确保事件处理程序与事件相关联 RenderGripThen name the instance ToolStripRenderer1 and ensure that the event handler is associated with the RenderGrip event.

private void ToolStripRenderer1_RenderGrip(Object sender, ToolStripGripRenderEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "GripBounds", e.GripBounds );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "GripDisplayStyle", e.GripDisplayStyle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "GripStyle", e.GripStyle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "AffectedBounds", e.AffectedBounds );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "BackColor", e.BackColor );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ToolStrip", e.ToolStrip );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ConnectedArea", e.ConnectedArea );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RenderGrip Event" );
}
Private Sub ToolStripRenderer1_RenderGrip(sender as Object, e as ToolStripGripRenderEventArgs) _ 
     Handles ToolStripRenderer1.RenderGrip

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "GripBounds", e.GripBounds)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "GripDisplayStyle", e.GripDisplayStyle)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "GripStyle", e.GripStyle)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "AffectedBounds", e.AffectedBounds)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "BackColor", e.BackColor)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ToolStrip", e.ToolStrip)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ConnectedArea", e.ConnectedArea)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RenderGrip Event")

End Sub

构造函数

ToolStripGripRenderEventArgs(Graphics, ToolStrip)

初始化 ToolStripGripRenderEventArgs 类的新实例。Initializes a new instance of the ToolStripGripRenderEventArgs class.

属性

AffectedBounds

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

(继承自 ToolStripRenderEventArgs)
BackColor

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

(继承自 ToolStripRenderEventArgs)
ConnectedArea

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

(继承自 ToolStripRenderEventArgs)
Graphics

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

(继承自 ToolStripRenderEventArgs)
GripBounds

获取一个矩形,表示要在其中绘制移动控制柄的区域。Gets the rectangle representing the area in which to paint the move handle.

GripDisplayStyle

获取样式,指示是垂直还是水平显示移动控制柄。Gets the style that indicates whether the move handle is displayed vertically or horizontally.

GripStyle

获取指示移动控制柄是否可见的样式。Gets the style that indicates whether or not the move handle is visible.

ToolStrip

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

(继承自 ToolStripRenderEventArgs)

方法

Equals(Object)

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

(继承自 Object)
GetHashCode()

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

(继承自 Object)
GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
ToString()

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

(继承自 Object)

适用于