DrawListViewColumnHeaderEventArgs.State DrawListViewColumnHeaderEventArgs.State DrawListViewColumnHeaderEventArgs.State DrawListViewColumnHeaderEventArgs.State Property

定義

列ヘッダーの現在の状態を取得します。Gets the current state of the column header.

public:
 property System::Windows::Forms::ListViewItemStates State { System::Windows::Forms::ListViewItemStates get(); };
public System.Windows.Forms.ListViewItemStates State { get; }
member this.State : System.Windows.Forms.ListViewItemStates
Public ReadOnly Property State As ListViewItemStates

プロパティ値

列ヘッダーの現在の状態を示す ListViewItemStates 値のビットごとの組み合わせ。A bitwise combination of ListViewItemStates values indicating the current state of the column header.

次のコード例では、このメンバーの使用を示します。The following code example demonstrates the use of this member. 例では、イベント ハンドラーが発生するときに報告、ListView.DrawColumnHeaderイベント。In the example, an event handler reports on the occurrence of the ListView.DrawColumnHeader event. このレポートでは、イベントが発生してデバッグに役立つについて説明します。This report helps you to learn when the event occurs and can assist you in debugging.

コード例を実行する型のインスタンスを含むプロジェクトに貼り付けることListViewというListView1します。To run the example code, paste it into a project that contains an instance of type ListView named ListView1. イベント ハンドラーに関連付けられていることを確認し、ListView.DrawColumnHeaderイベント。Then ensure that the event handler is associated with the ListView.DrawColumnHeader event.

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

注釈

ヘッダーの上にマウス ポインターがかどうか、またはユーザーが、ヘッダーをクリックするかどうかを判断するのにには、このプロパティを使用します。Use this property to determine whether the mouse pointer is over the header or whether the user has clicked the header. ListViewItemStates値は、これらの状態はHotSelectedします。The ListViewItemStates values for these states are Hot and Selected.

適用対象

こちらもご覧ください