Aracılığıyla paylaş


MenuItem.Shortcut Özellik

Tanım

Menü öğesiyle ilişkili kısayol tuşunu gösteren bir değeri alır veya ayarlar.

public:
 property System::Windows::Forms::Shortcut Shortcut { System::Windows::Forms::Shortcut get(); void set(System::Windows::Forms::Shortcut value); };
public System.Windows.Forms.Shortcut Shortcut { get; set; }
member this.Shortcut : System.Windows.Forms.Shortcut with get, set
Public Property Shortcut As Shortcut

Özellik Değeri

Shortcut

Değerlerden Shortcut biri. Varsayılan değer: Shortcut.None.

Özel durumlar

Atanan değer değerlerden Shortcut biri değildir.

Ö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ünümü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

Kısayol tuşları, kullanıcıların menü sisteminizde sık kullanılan menü öğelerini etkinleştirmesi ve fare veya başka bir işaretçi cihazına erişimi olmayan kullanıcılar için uygulamanıza klavye erişimi sağlaması için bir yöntem sağlar.

Şunlara uygulanır

Ayrıca bkz.