Form.MainMenuStrip 属性

定义

获取或设置窗体的主菜单容器。Gets or sets the primary menu container for the form.

public:
 property System::Windows::Forms::MenuStrip ^ MainMenuStrip { System::Windows::Forms::MenuStrip ^ get(); void set(System::Windows::Forms::MenuStrip ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ReferenceConverter))]
public System.Windows.Forms.MenuStrip MainMenuStrip { get; set; }
member this.MainMenuStrip : System.Windows.Forms.MenuStrip with get, set
Public Property MainMenuStrip As MenuStrip

属性值

MenuStrip 表示窗体菜单结构的容器。A MenuStrip that represents the container for the menu structure of the form. 默认值为 nullThe default is null.

属性

注解

除了设置 MainMenuStrip 属性,还必须 Add MenuStrip 控件添加到窗体的 Controls 集合。In addition to setting the MainMenuStrip property, you must Add the MenuStrip control to the Controls collection of the form.

MenuStrip 类取代了 .NET Framework 以前版本中的 MainMenu 类。The MenuStrip class supersedes the MainMenu class in previous versions of the .NET Framework.

适用于

另请参阅