MenuItem.Visible Özellik

Tanım

Menü öğesinin görünür olup olmadığını belirten bir değer alır veya ayarlar.

public:
 property bool Visible { bool get(); void set(bool value); };
public bool Visible { get; set; }
member this.Visible : bool with get, set
Public Property Visible As Boolean

Özellik Değeri

true menü öğesi menüde görünür hale getirilecekse; aksi takdirde , false. Varsayılan değer: true.

Örnekler

Aşağıdaki kod örneği bir menü öğesi oluşturur, resim yazısını ayarlar, bir kısayol tuşu atar, menü öğesini görünür hale getirir ve menü öğesi için kısayol tuşu görüntüsünü gösterir. Örnek, adlı menuItem1bir MenuItem oluşturulmuş olmasını gerektirir.

public:
   void SetupMyMenuItem()
   {
      // Set the caption for the menu item.
      menuItem1->Text = "&New";
      // Assign a shortcut key.
      menuItem1->Shortcut = Shortcut::CtrlN;
      // Make the menu item visible.
      menuItem1->Visible = true;
      // Display the shortcut key combination.
      menuItem1->ShowShortcut = true;
   }
public void SetupMyMenuItem()
{
   // Set the caption for the menu item.
   menuItem1.Text = "&New";
   // Assign a shortcut key.
   menuItem1.Shortcut = Shortcut.CtrlN;
   // Make the menu item visible.
   menuItem1.Visible = true;
   // Display the shortcut key combination.
   menuItem1.ShowShortcut = true;
}
Public Sub SetupMyMenuItem()
    ' Set the caption for the menu item.
    menuItem1.Text = "&New"
    ' Assign a shortcut key.
    menuItem1.Shortcut = Shortcut.CtrlN
    ' Make the menu item visible.
    menuItem1.Visible = True
    ' Display the shortcut key combination.
    menuItem1.ShowShortcut = True
End Sub

Açıklamalar

Menüleri birleştirmek veya menüleri devre dışı bırakmak zorunda kalmadan menü yapısını değiştirmek için bu özelliği kullanabilirsiniz. Örneğin, uygulamanızın menülerinden işlevlerin tam bir bölümünü gizlemek istiyorsanız, bu özelliği falseolarak ayarlayarak bunları kullanıcıdan gizleyebilirsiniz.

Şunlara uygulanır