Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações. |
Tradução
Original
|
Classe TableLayoutCellPaintEventArgs
Fornece dados para o CellPaint evento.
Assembly: System.Windows.Forms (em System.Windows.Forms.dll)
O exemplo a seguir mostra como um TableLayoutCellPaintEventArgs Para personalizar a aparência de um TableLayoutPanel controle. Este exemplo de código faz parte de um exemplo maior fornecido para o TableLayoutPanel controle.
publicclass DemoTableLayoutPanel : TableLayoutPanel
{
protectedoverridevoid 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
System.EventArgs
System.Windows.Forms.PaintEventArgs
System.Windows.Forms.TableLayoutCellPaintEventArgs
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.
Conteúdo da Comunidade
Adicionar