DrawListViewColumnHeaderEventArgs.Font 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得用來描繪資料行頁首文字的字型。
public:
property System::Drawing::Font ^ Font { System::Drawing::Font ^ get(); };
public System.Drawing.Font Font { get; }
public System.Drawing.Font? Font { get; }
member this.Font : System.Drawing.Font
Public ReadOnly Property Font As Font
屬性值
Font,表示行首文字的字型。
範例
下列程式碼範例示範此成員的使用。 在此範例中,事件處理常式會報告事件發生次數 ListView.DrawColumnHeader 。 此報告可協助您瞭解事件發生的時間,並可協助您進行偵錯。
若要執行範例程式碼,請將它貼到包含名為 ListView1
之型 ListView 別實例的專案。 然後,確定事件處理常式與事件相關聯 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