MenuItem.Shortcut 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
메뉴 항목과 연결된 바로 가기 키를 나타내는 값을 가져오거나 설정합니다.
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
속성 값
값 중 Shortcut 하나입니다. 기본값은 Shortcut.None입니다.
예외
할당된 값이 값 중 Shortcut 하나가 아닙니다.
예제
다음 코드 예제에서는 메뉴 항목을 만들고, 캡션을 설정하고, 바로 가기 키를 할당하고, 메뉴 항목을 표시하고, 메뉴 항목에 대한 바로 가기 키 표시를 보여 줍니다. 이 예제에서는 이름이 MenuItem지정된 a 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
설명
바로 가기 키는 사용자가 메뉴 시스템에서 자주 사용하는 메뉴 항목을 활성화하고 마우스 또는 다른 포인터 디바이스에 액세스할 수 없는 사용자를 위해 애플리케이션에 키보드 액세스를 제공하는 방법을 제공합니다.