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 표에 있는 셀의 그리기를 지원하기 위해 셀의 행, 열 및 경계에 대한 정보를 제공합니다.

생성자

Name Description
TableLayoutCellPaintEventArgs(Graphics, Rectangle, Rectangle, Int32, Int32)

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

속성

Name Description
CellBounds

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

ClipRectangle

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

(다음에서 상속됨 PaintEventArgs)
Column

셀의 열을 가져옵니다.

Graphics

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

(다음에서 상속됨 PaintEventArgs)
Row

셀의 행을 가져옵니다.

메서드

Name Description
Dispose()

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

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

관리되지 않는 리소스를 PaintEventArgs 해제하고 관리되는 리소스를 선택적으로 해제합니다.

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

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

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

기본 해시 함수로 사용됩니다.

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

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

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

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

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

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

Name Description
IDeviceContext.GetHdc()

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

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

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

(다음에서 상속됨 PaintEventArgs)

적용 대상

추가 정보