ToolStripButton.CheckedChanged イベント
メモ : このイベントは、.NET Framework version 2.0 で新しく追加されたものです。
Checked プロパティの値が変更された場合に発生します。
名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
Public Event CheckedChanged As EventHandler
Dim instance As ToolStripButton Dim handler As EventHandler AddHandler instance.CheckedChanged, handler
public event EventHandler CheckedChanged
public: event EventHandler^ CheckedChanged { void add (EventHandler^ value); void remove (EventHandler^ value); }
/** @event */ public void add_CheckedChanged (EventHandler value) /** @event */ public void remove_CheckedChanged (EventHandler value)


CheckOnClick プロパティを true に設定し、CheckedChanged のイベントで Checked プロパティを使用して、ボタンがクリックされたときにボタンのテキストのフォントを太字に変更するコード例を次に示します。
Friend WithEvents boldButton As ToolStripButton Private Sub InitializeBoldButton() boldButton = New ToolStripButton() boldButton.Text = "B" boldButton.CheckOnClick = True toolStrip1.Items.Add(boldButton) End Sub Private Sub boldButton_CheckedChanged(ByVal sender As [Object], _ ByVal e As EventArgs) Handles boldButton.CheckedChanged If boldButton.Checked Then Me.Font = New Font(Me.Font, FontStyle.Bold) Else Me.Font = New Font(Me.Font, FontStyle.Regular) End If End Sub
internal ToolStripButton boldButton; private void InitializeBoldButton() { boldButton = new ToolStripButton(); boldButton.Text = "B"; boldButton.CheckOnClick = true; toolStrip1.Items.Add(boldButton); } private void boldButton_CheckedChanged(object sender, EventArgs e) { if (boldButton.Checked) { this.Font = new Font(this.Font, FontStyle.Bold); } else { this.Font = new Font(this.Font, FontStyle.Regular); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からToolStripButton.CheckedChanged イベントを検索する場合は、下記のリンクをクリックしてください。

- ToolStripButton.CheckedChanged イベントのページへのリンク