TableLayoutCellPaintEventArgsとは? わかりやすく解説

TableLayoutCellPaintEventArgs クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

CellPaint イベントのデータを提供します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Class TableLayoutCellPaintEventArgs
    Inherits PaintEventArgs
Dim instance As TableLayoutCellPaintEventArgs
public class TableLayoutCellPaintEventArgs
 : PaintEventArgs
public ref class TableLayoutCellPaintEventArgs
 : public PaintEventArgs
public class TableLayoutCellPaintEventArgs
 extends PaintEventArgs
public class TableLayoutCellPaintEventArgs
 extends PaintEventArgs
解説解説

TableLayoutCellPaintEventArgs クラスは、表中のセルの描画をサポートするために、行、列、およびセルの境界に関する情報を提供します。

使用例使用例

TableLayoutCellPaintEventArgs を使用して、TableLayoutPanel コントロールの表示形式をカスタマイズする方法を次の例に示します。このコード例は TableLayoutPanel コントロールのトピックで取り上げているコード例の一部です。

Public Class DemoTableLayoutPanel
    Inherits TableLayoutPanel

    Protected Overrides Sub
 OnCellPaint( _
    ByVal e As System.Windows.Forms.TableLayoutCellPaintEventArgs)

        MyBase.OnCellPaint(e)

        Dim c As Control = Me.GetControlFromPosition(e.Column,
 e.Row)

        If Not c Is Nothing
 Then
            Dim g As Graphics = e.Graphics

            g.DrawRectangle( _
            Pens.Red, _
            e.CellBounds.Location.X + 1, _
            e.CellBounds.Location.Y + 1, _
            e.CellBounds.Width - 2, _
            e.CellBounds.Height - 2)

            g.FillRectangle( _
            Brushes.Blue, _
            e.CellBounds.Location.X + 1, _
            e.CellBounds.Location.Y + 1, _
            e.CellBounds.Width - 2, _
            e.CellBounds.Height - 2)
        End If

    End Sub

End Class
public class DemoTableLayoutPanel : TableLayoutPanel
{
    protected override void OnCellPaint(TableLayoutCellPaintEventArgs
 e)
    {
        base.OnCellPaint(e);

        Control c = this.GetControlFromPosition(e.Column, e.Row);

        if ( c != null )
        {
            Graphics g = e.Graphics;

            g.DrawRectangle(
                Pens.Red, 
                e.CellBounds.Location.X+1,
                e.CellBounds.Location.Y + 1,
                e.CellBounds.Width - 2, e.CellBounds.Height - 2);

            g.FillRectangle(
                Brushes.Blue, 
                e.CellBounds.Location.X + 1, 
                e.CellBounds.Location.Y + 1, 
                e.CellBounds.Width - 2, 
                e.CellBounds.Height - 2);
        };
    }
    
}
継承階層継承階層
System.Object
   System.EventArgs
     System.Windows.Forms.PaintEventArgs
      System.Windows.Forms.TableLayoutCellPaintEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TableLayoutCellPaintEventArgs メンバ
System.Windows.Forms 名前空間
TableLayoutPanel

TableLayoutCellPaintEventArgs コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

TableLayoutCellPaintEventArgs クラスの新しいインスタンスを初期化します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub New ( _
    g As Graphics, _
    clipRectangle As Rectangle, _
    cellBounds As Rectangle, _
    column As Integer, _
    row As Integer _
)
Dim g As Graphics
Dim clipRectangle As Rectangle
Dim cellBounds As Rectangle
Dim column As Integer
Dim row As Integer

Dim instance As New TableLayoutCellPaintEventArgs(g,
 clipRectangle, cellBounds, column, row)
public TableLayoutCellPaintEventArgs (
    Graphics g,
    Rectangle clipRectangle,
    Rectangle cellBounds,
    int column,
    int row
)
public:
TableLayoutCellPaintEventArgs (
    Graphics^ g, 
    Rectangle clipRectangle, 
    Rectangle cellBounds, 
    int column, 
    int row
)
public TableLayoutCellPaintEventArgs (
    Graphics g, 
    Rectangle clipRectangle, 
    Rectangle cellBounds, 
    int column, 
    int row
)
public function TableLayoutCellPaintEventArgs
 (
    g : Graphics, 
    clipRectangle : Rectangle, 
    cellBounds : Rectangle, 
    column : int, 
    row : int
)

パラメータ

g

項目の描画に使用される Graphics。

clipRectangle

描画先の四角形を表す Rectangle。

cellBounds

セルの境界。

column

セルの列。

row

セルの行。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TableLayoutCellPaintEventArgs クラス
TableLayoutCellPaintEventArgs メンバ
System.Windows.Forms 名前空間
TableLayoutPanel

TableLayoutCellPaintEventArgs プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

TableLayoutCellPaintEventArgs クラス
System.Windows.Forms 名前空間
TableLayoutPanel

TableLayoutCellPaintEventArgs メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Dispose  オーバーロードされます。 PaintEventArgs によって使用されているリソースを解放します。 ( PaintEventArgs から継承されます。)
プロテクト メソッド Finalize  ( PaintEventArgs から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 ( Object から継承されます。)
参照参照

関連項目

TableLayoutCellPaintEventArgs クラス
System.Windows.Forms 名前空間
TableLayoutPanel

TableLayoutCellPaintEventArgs メンバ

CellPaint イベントのデータを提供します。

TableLayoutCellPaintEventArgs データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド TableLayoutCellPaintEventArgs TableLayoutCellPaintEventArgs クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Dispose  オーバーロードされます。 PaintEventArgs によって使用されているリソースを解放します。 (PaintEventArgs から継承されます。)
プロテクト メソッド Finalize  ( PaintEventArgs から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 (Object から継承されます。)
参照参照

関連項目

TableLayoutCellPaintEventArgs クラス
System.Windows.Forms 名前空間
TableLayoutPanel



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「TableLayoutCellPaintEventArgs」の関連用語

TableLayoutCellPaintEventArgsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TableLayoutCellPaintEventArgsのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS