DataGridViewColumnStateChangedEventArgs クラス

定義

ColumnStateChanged イベントのデータを提供します。

public ref class DataGridViewColumnStateChangedEventArgs : EventArgs
public class DataGridViewColumnStateChangedEventArgs : EventArgs
type DataGridViewColumnStateChangedEventArgs = class
    inherit EventArgs
Public Class DataGridViewColumnStateChangedEventArgs
Inherits EventArgs
継承
DataGridViewColumnStateChangedEventArgs

次のコード例では、この型の使用方法を示します。 この例では、イベント ハンドラーは、 ColumnStateChanged イベントの発生を報告します。 このレポートは、イベントがいつ発生するかを学習するのに役立ち、デバッグに役立ちます。 複数のイベントや頻繁に発生するイベントについて報告するには、 ShowConsole.WriteLine に置き換えるか、メッセージを複数行の TextBoxに追加することを検討してください。

コード例を実行するには、DataGridViewという名前の型のインスタンスを含むプロジェクトDataGridView1貼り付けます。 次に、イベント ハンドラーが ColumnStateChanged イベントに関連付けられていることを確認します。

private void DataGridView1_ColumnStateChanged(Object sender, DataGridViewColumnStateChangedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Column", e.Column );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "StateChanged", e.StateChanged );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ColumnStateChanged Event" );
}
Private Sub DataGridView1_ColumnStateChanged(sender as Object, e as DataGridViewColumnStateChangedEventArgs) _ 
     Handles DataGridView1.ColumnStateChanged

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Column", e.Column)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "StateChanged", e.StateChanged)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"ColumnStateChanged Event")

End Sub

注釈

このイベントは、DataGridView コントロールのDataGridViewColumnに対して次のいずれかの列プロパティの値が変更されたときに発生します。

イベントの処理方法の詳細については、「イベントの 処理と発生」を参照してください。

コンストラクター

名前 説明
DataGridViewColumnStateChangedEventArgs(DataGridViewColumn, DataGridViewElementStates)

DataGridViewColumnStateChangedEventArgs クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Column

状態が変更された列を取得します。

StateChanged

新しい列の状態を取得します。

メソッド

名前 説明
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください