ToolStrip.PaintGrip Zdarzenie

Definicja

Występuje, gdy ToolStrip uchwyt przenoszenia jest malowany.

public:
 event System::Windows::Forms::PaintEventHandler ^ PaintGrip;
public event System.Windows.Forms.PaintEventHandler PaintGrip;
public event System.Windows.Forms.PaintEventHandler? PaintGrip;
member this.PaintGrip : System.Windows.Forms.PaintEventHandler 
Public Custom Event PaintGrip As PaintEventHandler 

Typ zdarzenia

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 PaintGrip 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 ToolStrip o nazwie ToolStrip1. Następnie upewnij się, że program obsługi zdarzeń jest skojarzony ze zdarzeniem PaintGrip .

private void ToolStrip1_PaintGrip(Object sender, PaintEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ClipRectangle", e.ClipRectangle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "PaintGrip Event" );
}
Private Sub ToolStrip1_PaintGrip(sender as Object, e as PaintEventArgs) _ 
     Handles ToolStrip1.PaintGrip

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "ClipRectangle", e.ClipRectangle)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"PaintGrip Event")

End Sub

Uwagi

Aby uzyskać więcej informacji na temat obsługi zdarzeń, zobacz Obsługa i podnoszenie zdarzeń.

Dotyczy