TableLayoutCellPaintEventArgs クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)



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.EventArgs
System.Windows.Forms.PaintEventArgs
System.Windows.Forms.TableLayoutCellPaintEventArgs


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TableLayoutCellPaintEventArgs コンストラクタ
アセンブリ: 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 )

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TableLayoutCellPaintEventArgs クラス
TableLayoutCellPaintEventArgs メンバ
System.Windows.Forms 名前空間
TableLayoutPanel
TableLayoutCellPaintEventArgs プロパティ

名前 | 説明 | |
---|---|---|
![]() | CellBounds | セルのサイズと位置を取得します。 |
![]() | ClipRectangle | 描画先の四角形を取得します。 ( PaintEventArgs から継承されます。) |
![]() | Column | セルの列を取得します。 |
![]() | Graphics | 描画に使用するグラフィックスを取得します。 ( PaintEventArgs から継承されます。) |
![]() | Row | セルの行を取得します。 |

TableLayoutCellPaintEventArgs メソッド

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 PaintEventArgs によって使用されているリソースを解放します。 ( PaintEventArgs から継承されます。) |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 PaintEventArgs によって使用されているリソースを解放します。 ( PaintEventArgs から継承されます。) |
![]() | Finalize | ( PaintEventArgs から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

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


名前 | 説明 | |
---|---|---|
![]() | CellBounds | セルのサイズと位置を取得します。 |
![]() | ClipRectangle | 描画先の四角形を取得します。(PaintEventArgs から継承されます。) |
![]() | Column | セルの列を取得します。 |
![]() | Graphics | 描画に使用するグラフィックスを取得します。(PaintEventArgs から継承されます。) |
![]() | Row | セルの行を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 PaintEventArgs によって使用されているリソースを解放します。 (PaintEventArgs から継承されます。) |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 PaintEventArgs によって使用されているリソースを解放します。 (PaintEventArgs から継承されます。) |
![]() | Finalize | ( PaintEventArgs から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- TableLayoutCellPaintEventArgsのページへのリンク