Share via


MenuItem.Visible 속성

정의

메뉴 항목이 표시되는지를 나타내는 값을 가져오거나 설정합니다.

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

속성 값

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

설명

메뉴를 병합 하거나 메뉴를 사용 하지 않도록 설정 하지 않고도 메뉴 구조를 수정 하려면이 속성을 사용할 수 있습니다. 예를 들어, 애플리케이션의 메뉴에서 기능의 전체 섹션을 숨기려는 경우 해당 숨길 수 있습니다 사용자 로부터이 속성을 설정 하 여 false입니다.

적용 대상