DrawListViewColumnHeaderEventArgs.DrawDefault 속성

정의

소유자 대신 운영 체제에서 열 머리글을 그리는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool DrawDefault { bool get(); void set(bool value); };
public bool DrawDefault { get; set; }
member this.DrawDefault : bool with get, set
Public Property DrawDefault As Boolean

속성 값

운영 체제에서 머리글을 그려야 하면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 코드 예제에서는이 멤버를 사용 하는 방법을 보여 줍니다. 예제에서는 이벤트 처리기에서 보고서를 ListView.DrawColumnHeader 이벤트입니다. 이 보고서를 통해 이벤트 발생 하 고 도움이 될 수 있습니다 디버깅 하는 경우를 학습할 수 있습니다.

예제 코드를 실행 하려면 형식의 인스턴스를 포함 하는 프로젝트에 붙여넣습니다 ListView 라는 ListView1합니다. 연결 된 이벤트 처리기는 확인 된 ListView.DrawColumnHeader 이벤트입니다.

private void ListView1_DrawColumnHeader(Object sender, DrawListViewColumnHeaderEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "DrawDefault", e.DrawDefault );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Bounds", e.Bounds );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Header", e.Header );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "State", e.State );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ForeColor", e.ForeColor );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "BackColor", e.BackColor );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Font", e.Font );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "DrawColumnHeader Event" );
}
Private Sub ListView1_DrawColumnHeader(sender as Object, e as DrawListViewColumnHeaderEventArgs) _ 
     Handles ListView1.DrawColumnHeader

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "DrawDefault", e.DrawDefault)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Bounds", e.Bounds)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Header", e.Header)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "State", e.State)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ForeColor", e.ForeColor)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "BackColor", e.BackColor)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Font", e.Font)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"DrawColumnHeader Event")

End Sub

설명

처리 하는 경우이 속성을 사용 합니다 ListView.DrawColumnHeader 헤더 사용자 지정 하지 않으려는 경우에 대 한 이벤트입니다. 이 속성을 설정 하는 경우 true, 일반적으로 헤더 그려집니다.

적용 대상

추가 정보