Control.Focused プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)



TextBox にフォーカスがない場合に MenuItem を無効にする例を次に示します。この例では、menuItemEdit および menuItemEditInsertCustomerInfo という 2 つの MenuItem オブジェクトと、textBox1 という TextBox を持つ Form が存在している必要があります。
Private Sub menuItemEdit_Popup(sender As Object, _ e As EventArgs) Handles menuItemEdit.Popup ' Disable the menu item if the text box does not have focus. Me.menuItemEditInsertCustomerInfo.Enabled = Me.textBox1.Focused End Sub
private void menuItemEdit_Popup(object sender, EventArgs e) { // Disable the menu item if the text box does not have focus. this.menuItemEditInsertCustomerInfo.Enabled = this.textBox1.Focused; }

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に収録されているすべての辞書からControl.Focused プロパティを検索する場合は、下記のリンクをクリックしてください。

- Control.Focused プロパティのページへのリンク