TableLayoutPanel.CellPaint イベント

定義

セルが再描画されると発生します。

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

イベントの種類

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

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

private void TableLayoutPanel1_CellPaint(Object sender, TableLayoutCellPaintEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "CellBounds", e.CellBounds );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Row", e.Row );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Column", e.Column );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ClipRectangle", e.ClipRectangle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "CellPaint Event" );
}
Private Sub TableLayoutPanel1_CellPaint(sender as Object, e as TableLayoutCellPaintEventArgs) _ 
     Handles TableLayoutPanel1.CellPaint

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

End Sub

注釈

イベントの処理の詳細については、「処理とイベントの発生」を参照してください。

適用対象