ToolStripGripRenderEventArgs.GripStyle Właściwość

Definicja

Pobiera styl wskazujący, czy uchwyt przenoszenia jest widoczny.

public:
 property System::Windows::Forms::ToolStripGripStyle GripStyle { System::Windows::Forms::ToolStripGripStyle get(); };
public System.Windows.Forms.ToolStripGripStyle GripStyle { get; }
member this.GripStyle : System.Windows.Forms.ToolStripGripStyle
Public ReadOnly Property GripStyle As ToolStripGripStyle

Wartość właściwości

ToolStripGripDisplayStyle Jedna z wartości.

Przykłady

W poniższym przykładzie kodu pokazano użycie tego elementu członkowskiego. W tym przykładzie program obsługi zdarzeń zgłasza wystąpienie ToolStripRenderer.RenderGrip zdarzenia. Ten raport pomaga dowiedzieć się, kiedy wystąpi zdarzenie, i może pomóc w debugowaniu.

Aby uruchomić przykładowy kod, wklej go w projekcie zawierającym wystąpienie typu dziedziczonego z ToolStripRendererelementu , takiego jak ToolStripSystemRenderer lub ToolStripProfessionalRenderer. Następnie nadaj wystąpieniu ToolStripRenderer1 nazwę i upewnij się, że program obsługi zdarzeń jest skojarzony ze zdarzeniem ToolStripRenderer.RenderGrip .

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

Dotyczy