TableLayoutCellPaintEventArgs 클래스

정의

CellPaint 이벤트에 대한 데이터를 제공합니다.

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
상속
TableLayoutCellPaintEventArgs

예제

다음 예제와 방법을 TableLayoutCellPaintEventArgs 의 모양을 사용자 지정할 수는 TableLayoutPanel 컨트롤입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 TableLayoutPanel 제어 합니다.

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

설명

TableLayoutCellPaintEventArgs 클래스 행, 열 및 테이블에서 셀의 그리기를 지원 하기 위해 셀의 범위에 대 한 정보를 제공 합니다.

생성자

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

TableLayoutCellPaintEventArgs 클래스의 새 인스턴스를 초기화합니다.

속성

CellBounds

셀의 크기와 위치를 가져옵니다.

ClipRectangle

항목을 그릴 사각형을 가져옵니다.

(다음에서 상속됨 PaintEventArgs)
Column

셀의 열을 가져옵니다.

Graphics

그리는 데 사용되는 그래픽을 가져옵니다.

(다음에서 상속됨 PaintEventArgs)
Row

셀의 행을 가져옵니다.

메서드

Dispose()

PaintEventArgs에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 PaintEventArgs)
Dispose(Boolean)

PaintEventArgs에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 PaintEventArgs)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IDeviceContext.GetHdc()

Windows 디바이스 컨텍스트의 핸들을 반환합니다.

(다음에서 상속됨 PaintEventArgs)
IDeviceContext.ReleaseHdc()

Windows 디바이스 컨텍스트의 핸들을 해제합니다.

(다음에서 상속됨 PaintEventArgs)

적용 대상

추가 정보