ToolStripGripRenderEventArgs ToolStripGripRenderEventArgs ToolStripGripRenderEventArgs ToolStripGripRenderEventArgs Class

定义

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
继承
ToolStripGripRenderEventArgsToolStripGripRenderEventArgsToolStripGripRenderEventArgsToolStripGripRenderEventArgs

示例

下面的代码示例演示如何使用此类型。The following code example demonstrates the use of this type. 在示例中,事件处理程序报告的匹配项RenderGrip事件。In 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,并确保事件处理程序相关联RenderGrip事件。Then 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(Graphics, ToolStrip) ToolStripGripRenderEventArgs(Graphics, ToolStrip) ToolStripGripRenderEventArgs(Graphics, ToolStrip)

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

属性

AffectedBounds AffectedBounds AffectedBounds AffectedBounds

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

(Inherited from ToolStripRenderEventArgs)
BackColor BackColor BackColor BackColor

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

(Inherited from ToolStripRenderEventArgs)
ConnectedArea ConnectedArea ConnectedArea ConnectedArea

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

(Inherited from ToolStripRenderEventArgs)
Graphics Graphics Graphics Graphics

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

(Inherited from ToolStripRenderEventArgs)
GripBounds GripBounds GripBounds GripBounds

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

GripDisplayStyle GripDisplayStyle GripDisplayStyle GripDisplayStyle

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

GripStyle GripStyle GripStyle GripStyle

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

ToolStrip ToolStrip ToolStrip ToolStrip

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

(Inherited from ToolStripRenderEventArgs)

方法

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)

适用于