DataGridView.ForeColorChanged イベント

定義

ForeColor プロパティの値が変化すると発生します。

public:
 event EventHandler ^ ForeColorChanged;
[System.ComponentModel.Browsable(false)]
public event EventHandler ForeColorChanged;
[System.ComponentModel.Browsable(false)]
public event EventHandler? ForeColorChanged;
[<System.ComponentModel.Browsable(false)>]
member this.ForeColorChanged : EventHandler 
Public Custom Event ForeColorChanged As EventHandler 

イベントの種類

属性

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

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

private void DataGridView1_ForeColorChanged(Object sender, EventArgs e) {

   MessageBox.Show("You are in the DataGridView.ForeColorChanged event.");
}
Private Sub DataGridView1_ForeColorChanged(sender as Object, e as EventArgs) _ 
     Handles DataGridView1.ForeColorChanged

   MessageBox.Show("You are in the DataGridView.ForeColorChanged event.")

End Sub

注釈

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

適用対象

こちらもご覧ください