DataGridViewRowPostPaintEventArgs.ClipBounds プロパティ

定義

再描画が必要な DataGridView の領域を取得または設定します。

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

プロパティ値

再描画が必要な DataGridView の領域を表す Rectangle

次のコード例では、このメンバーの使用方法を示します。 この例では、イベント ハンドラーがイベントの DataGridView.RowPostPaint 発生を報告します。 このレポートは、イベントが発生したタイミングを知るのに役立ち、デバッグに役立ちます。

コード例を実行するには、 という名前DataGridView1の型DataGridViewのインスタンスを含むプロジェクトに貼り付けます。 次に、イベント ハンドラーが イベントに関連付けられていることを確認します DataGridView.RowPostPaint

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

注釈

プロパティは ClipBounds 、再描画する必要がある の DataGridView 領域を表します。 たとえば、ユーザーが別のウィンドウで全体 DataGridView をカバーし、それを明らかにする場合 ClipBounds は、 全体 DataGridViewを表します。 ユーザーが の DataGridView 小さな領域をカバーし、それを明らかにする場合 ClipBounds は、カバーされた小さな領域を表します。

適用対象

こちらもご覧ください