TableLayoutCellPaintEventArgs TableLayoutCellPaintEventArgs TableLayoutCellPaintEventArgs TableLayoutCellPaintEventArgs Class

Definición

Proporciona datos para el evento CellPaint.Provides data for the CellPaint event.

public ref class TableLayoutCellPaintEventArgs : System::Windows::Forms::PaintEventArgs
public class TableLayoutCellPaintEventArgs : System.Windows.Forms.PaintEventArgs
type TableLayoutCellPaintEventArgs = class
    inherit PaintEventArgs
Public Class TableLayoutCellPaintEventArgs
Inherits PaintEventArgs
Herencia
TableLayoutCellPaintEventArgsTableLayoutCellPaintEventArgsTableLayoutCellPaintEventArgsTableLayoutCellPaintEventArgs

Ejemplos

En el ejemplo siguiente se muestra cómo TableLayoutCellPaintEventArgs personalizar la apariencia de un TableLayoutPanel control.The following example shows how to a TableLayoutCellPaintEventArgs to customize the appearance of a TableLayoutPanel control. Este ejemplo de código forma parte de un ejemplo mayor proporcionado para TableLayoutPanel el control.This code example is part of a larger example provided for the TableLayoutPanel control.

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);
        };
    }
    
}
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 c IsNot 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

Comentarios

La TableLayoutCellPaintEventArgs clase proporciona información sobre la fila, la columna y los límites de la celda para admitir el dibujo de la celda en la tabla.The TableLayoutCellPaintEventArgs class provides information about the row, column, and bounds of the cell to support painting of the cell in the table.

Constructores

TableLayoutCellPaintEventArgs(Graphics, Rectangle, Rectangle, Int32, Int32) TableLayoutCellPaintEventArgs(Graphics, Rectangle, Rectangle, Int32, Int32) TableLayoutCellPaintEventArgs(Graphics, Rectangle, Rectangle, Int32, Int32) TableLayoutCellPaintEventArgs(Graphics, Rectangle, Rectangle, Int32, Int32)

Inicializa una nueva instancia de la clase TableLayoutCellPaintEventArgs.Initializes a new instance of the TableLayoutCellPaintEventArgs class.

Propiedades

CellBounds CellBounds CellBounds CellBounds

Obtiene el tamaño y ubicación de la celda.Gets the size and location of the cell.

ClipRectangle ClipRectangle ClipRectangle ClipRectangle

Obtiene el rectángulo en el que se va a pintar.Gets the rectangle in which to paint.

(Inherited from PaintEventArgs)
Column Column Column Column

Obtiene la columna de la celda.Gets the column of the cell.

Graphics Graphics Graphics Graphics

Obtiene los gráficos que se utilizan para pintar.Gets the graphics used to paint.

(Inherited from PaintEventArgs)
Row Row Row Row

Obtiene la fila de la celda.Gets the row of the cell.

Métodos

Dispose() Dispose() Dispose() Dispose()

Libera todos los recursos que usa PaintEventArgs.Releases all resources used by the PaintEventArgs.

(Inherited from PaintEventArgs)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Libera los recursos no administrados que usa PaintEventArgs y, de forma opcional, libera los recursos administrados.Releases the unmanaged resources used by the PaintEventArgs and optionally releases the managed resources.

(Inherited from PaintEventArgs)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a

Consulte también: