TableLayoutCellPaintEventHandler デリゲート
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Delegate Sub TableLayoutCellPaintEventHandler ( _ sender As Object, _ e As TableLayoutCellPaintEventArgs _ )
public delegate void TableLayoutCellPaintEventHandler ( Object sender, TableLayoutCellPaintEventArgs e )
public delegate void TableLayoutCellPaintEventHandler ( Object^ sender, TableLayoutCellPaintEventArgs^ e )
/** @delegate */ public delegate void TableLayoutCellPaintEventHandler ( Object sender, TableLayoutCellPaintEventArgs e )

TableLayoutCellPaintEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを識別してください。イベントをイベント ハンドラに関連付けるには、デリゲートのインスタンスをイベントに追加します。デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラが呼び出されます。イベント ハンドラ デリゲートの詳細については、「イベントとデリゲート」を参照してください。

TableLayoutCellPaintEventHandler デリゲートを使用して、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); }; } }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTableLayoutCellPaintEventHandler デリゲートを検索する場合は、下記のリンクをクリックしてください。

- TableLayoutCellPaintEventHandler デリゲートのページへのリンク