ToolStripButton.CheckOnClick プロパティ
メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。
ToolStripButton がクリックされたときに、自動的に押された状態および押されていない状態で表示するかどうかを示す値を取得または設定します。
名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
Dim instance As ToolStripButton Dim value As Boolean value = instance.CheckOnClick instance.CheckOnClick = value
/** @property */ public boolean get_CheckOnClick () /** @property */ public void set_CheckOnClick (boolean value)
プロパティ値
ToolStripButton がクリックされたときに、自動的に押された状態および押されていない状態で表示する場合は true。それ以外の場合は false。既定値は false です。

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.CheckOnClick プロパティを検索する場合は、下記のリンクをクリックしてください。

- ToolStripButton.CheckOnClick プロパティのページへのリンク