DataGridViewCellStyleContentChangedEventArgs クラス

定義

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

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

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

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

private void DataGridView1_CellStyleContentChanged(Object sender, DataGridViewCellStyleContentChangedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "CellStyle", e.CellStyle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "CellStyleScope", e.CellStyleScope );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "CellStyleContentChanged Event" );
}
Private Sub DataGridView1_CellStyleContentChanged(sender as Object, e as DataGridViewCellStyleContentChangedEventArgs) _ 
     Handles DataGridView1.CellStyleContentChanged

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

End Sub

注釈

イベントは CellStyleContentChanged 、次のいずれかのプロパティによって返されるオブジェクトの DataGridViewCellStyle プロパティ値が変更されたときに発生します。

ただし、これらのプロパティのいずれかが別 DataGridViewCellStyle のオブジェクトに設定されている場合は、対応する PropertyNameChanged イベントが発生しますが、 CellStyleContentChanged イベントは発生しません。

プロパティを CellStyleScope 使用して、変更された を持つプロパティを DataGridViewCellStyle 確認します。 プロパティを CellStyle 使用して、更新された値を取得します。

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

プロパティ

CellStyle

変更された DataGridViewCellStyle を取得します。

CellStyleScope

変更されたセル スタイルが影響するスコープを取得します。

メソッド

Equals(Object)

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

(継承元 Object)
GetHashCode()

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

(継承元 Object)
GetType()

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

(継承元 Object)
MemberwiseClone()

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

(継承元 Object)
ToString()

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

(継承元 Object)

適用対象

こちらもご覧ください