TableLayoutCellPaintEventArgs Class
.NET Framework 2.0
Note: This class is new in the .NET Framework version 2.0.
Provides data for the CellPaint event.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Assembly: System.Windows.Forms (in system.windows.forms.dll)
The following example shows how to a TableLayoutCellPaintEventArgs to customize the appearance of a TableLayoutPanel control. This code example is part of a larger example provided for the TableLayoutPanel control.
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
System.Object
System.EventArgs
System.Windows.Forms.PaintEventArgs
System.Windows.Forms.TableLayoutCellPaintEventArgs
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
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show: