Freigeben über


DataGridViewRowPostPaintEventArgs.ClipBounds Eigenschaft

Definition

Dient zum Abrufen oder Festlegen des Bereichs, der DataGridView aktualisiert werden muss.

public:
 property System::Drawing::Rectangle ClipBounds { System::Drawing::Rectangle get(); void set(System::Drawing::Rectangle value); };
public System.Drawing.Rectangle ClipBounds { get; set; }
member this.ClipBounds : System.Drawing.Rectangle with get, set
Public Property ClipBounds As Rectangle

Eigenschaftswert

A Rectangle that represents the area of the DataGridView that needs to be repainted.

Beispiele

Im folgenden Codebeispiel wird die Verwendung dieses Elements veranschaulicht. Im Beispiel meldet ein Ereignishandler das Auftreten des DataGridView.RowPostPaint Ereignisses. Dieser Bericht hilft Ihnen, zu erfahren, wann das Ereignis auftritt und Sie beim Debuggen unterstützen kann.

Um den Beispielcode auszuführen, fügen Sie ihn in ein Projekt ein, das eine Instanz des Typs DataGridView namens DataGridView1enthält. Stellen Sie dann sicher, dass der Ereignishandler dem DataGridView.RowPostPaint Ereignis zugeordnet ist.

private void DataGridView1_RowPostPaint(Object sender, DataGridViewRowPostPaintEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ClipBounds", e.ClipBounds );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ErrorText", e.ErrorText );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "InheritedRowStyle", e.InheritedRowStyle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "IsFirstDisplayedRow", e.IsFirstDisplayedRow );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "IsLastVisibleRow", e.IsLastVisibleRow );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "RowBounds", e.RowBounds );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "State", e.State );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RowPostPaint Event" );
}
Private Sub DataGridView1_RowPostPaint(sender as Object, e as DataGridViewRowPostPaintEventArgs) _ 
     Handles DataGridView1.RowPostPaint

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "ClipBounds", e.ClipBounds)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ErrorText", e.ErrorText)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "InheritedRowStyle", e.InheritedRowStyle)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "IsFirstDisplayedRow", e.IsFirstDisplayedRow)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "IsLastVisibleRow", e.IsLastVisibleRow)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "RowBounds", e.RowBounds)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "State", e.State)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RowPostPaint Event")

End Sub

Hinweise

Die ClipBounds Eigenschaft stellt den Bereich dar, der DataGridView aktualisiert werden muss. Wenn ein Benutzer beispielsweise das gesamte DataGridView Fenster mit einem anderen Fenster abdeckt und es dann ClipBounds aufdeckt, dann stellt er den gesamten DataGridViewdar. Wenn ein Benutzer einen kleinen Bereich des DataGridView Bereichs abdeckt und es dann aufdeckt, stellt sie ClipBounds den kleinen Bereich dar, der abgedeckt wurde.

Gilt für:

Weitere Informationen