Control.Focused Özellik

Tanım

Denetimin giriş odağı olup olmadığını gösteren bir değer alır.

public:
 virtual property bool Focused { bool get(); };
[System.ComponentModel.Browsable(false)]
public virtual bool Focused { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Focused : bool
Public Overridable ReadOnly Property Focused As Boolean

Özellik Değeri

Boolean

true denetimin odağı varsa; aksi takdirde , false.

Öznitelikler

Örnekler

Aşağıdaki kod örneği, odak yoksa a'yi MenuItem TextBox devre dışı bırakır. Bu örnek, adlandırılmış ve Form ve adlı menuItemEdit textBox1 menuItemEditInsertCustomerInfoiki MenuItem nesneye sahip bir TextBox öğesinin olmasını gerektirir.

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;
   }
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;
}
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

Devralanlara Notlar

Türetilmiş bir sınıfta özelliğini geçersiz kıldığınızda Focused , temel uygulamayı genişletmek için temel sınıfın Focused özelliğini kullanın. Aksi takdirde, tüm uygulamayı sağlamanız gerekir.

Şunlara uygulanır

Ayrıca bkz.