DataGridViewRowPrePaintEventArgs.ClipBounds DataGridViewRowPrePaintEventArgs.ClipBounds DataGridViewRowPrePaintEventArgs.ClipBounds DataGridViewRowPrePaintEventArgs.ClipBounds Property

定義

再描画が必要な DataGridView の領域を取得または設定します。Gets or sets the area of the DataGridView that needs to be repainted.

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

プロパティ値

再描画が必要な Rectangle の領域を表す DataGridViewA Rectangle that represents the area of the DataGridView that needs to be repainted.

このメンバーの使用例を次のコード例に示します。The following code example demonstrates the use of this member. この例では、イベントハンドラーがDataGridView.RowPrePaintイベントの発生を報告します。In the example, an event handler reports on the occurrence of the DataGridView.RowPrePaint event. このレポートは、イベントがいつ発生し、デバッグに役立つかを理解するのに役立ちます。This report helps you to learn when the event occurs and can assist you in debugging.

コード例を実行するには、という名前DataGridView DataGridView1の型のインスタンスを含むプロジェクトに貼り付けます。To run the example code, paste it into a project that contains an instance of type DataGridView named DataGridView1. 次に、イベントハンドラーがDataGridView.RowPrePaintイベントに関連付けられていることを確認します。Then ensure that the event handler is associated with the DataGridView.RowPrePaint event.

private void DataGridView1_RowPrePaint(Object sender, DataGridViewRowPrePaintEventArgs 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}", "PaintParts", e.PaintParts );
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();
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RowPrePaint Event" );
}
Private Sub DataGridView1_RowPrePaint(sender as Object, e as DataGridViewRowPrePaintEventArgs) _ 
     Handles DataGridView1.RowPrePaint

    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}", "PaintParts", e.PaintParts)
    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()
    messageBoxVB.AppendFormat("{0} = {1}", "Handled", e.Handled)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RowPrePaint Event")

End Sub

注釈

プロパティClipBoundsは、再描画する必要DataGridViewがあるの領域を表します。The ClipBounds property represents the area of the DataGridView that needs to be repainted. たとえば、ユーザーが全体DataGridViewを別のウィンドウでカバーした後、そのClipBoundsウィンドウを明らかにするDataGridViewと、は全体を表します。For example, if a user covers the entire DataGridView with another window and then uncovers it, then ClipBounds represents the entire DataGridView. ユーザーがのDataGridView小さな領域を対象としている場合はClipBounds 、がカバーされた小さな領域を表します。If a user covers a small area of the DataGridView and then uncovers it, then ClipBounds represents the small area that was covered.

適用対象

こちらもご覧ください