MenuItem.ShowShortcut 속성

정의

메뉴 항목과 연결된 바로 가기 키가 메뉴 항목 캡션 옆에 표시되는지를 나타내는 값을 가져오거나 설정합니다.

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

속성 값

Boolean

바로 가기 키 조합이 메뉴 항목 캡션 옆에 표시되면 true이고, 바로 가기 키 조합이 표시되지 않으면 false입니다. 기본값은 true입니다.

예제

다음 코드 예제에서는 메뉴 항목을 만드는, 캡션을 설정, 바로 가기 키를 할당, 메뉴 항목을 표시 하면 및 메뉴 항목에 대 한 바로 가기 키 표시 예제에는 필요는 MenuItem 즉 만들었습니다 라는 menuItem1합니다.

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

설명

메뉴 공간을 절약 하거나 바로 가기 키 표시 되지 않도록 숨겨야 숨기려면 바로 가기 메뉴에서 사용자에 대 한 옵션을 제공 하려면이 속성을 사용할 수 있습니다.

적용 대상

추가 정보