本文整理汇总了C#中System.Windows.Forms.MainMenu类的典型用法代码示例。如果您正苦于以下问题:C# MainMenu类的具体用法?C# MainMenu怎么用?C# MainMenu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MainMenu类属于System.Windows.Forms命名空间,在下文中一共展示了MainMenu类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Transformer
public Transformer()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
Text = "COMP 4560: Assignment 5 (A00884869) (Duy Le)";
ResizeRedraw = true;
BackColor = Color.Black;
MenuItem miNewDat = new MenuItem("New &Data...",
new EventHandler(MenuNewDataOnClick));
MenuItem miExit = new MenuItem("E&xit",
new EventHandler(MenuFileExitOnClick));
MenuItem miDash = new MenuItem("-");
MenuItem miFile = new MenuItem("&File",
new MenuItem[] {miNewDat, miDash, miExit});
MenuItem miAbout = new MenuItem("&About",
new EventHandler(MenuAboutOnClick));
Menu = new MainMenu(new MenuItem[] {miFile, miAbout});
//foreach (var button in Controls.OfType<Button>())
//{
// button.Click += button_Click;
//}
_timer = new System.Windows.Forms.Timer();
_timer.Interval = 1;
}
开发者ID:duy159,项目名称:comp4560-asn5,代码行数:35,代码来源:Form1.cs
示例2: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
//
// mainMenu1
//
this.mainMenu1.MenuItems.Add(this.menuItem1);
//
// menuItem1
//
this.menuItem1.MenuItems.Add(this.menuItem2);
this.menuItem1.Text = "Opciones";
//
// menuItem2
//
this.menuItem2.MenuItems.Add(this.menuItem3);
this.menuItem2.Text = "Datos de Lectora";
//
// menuItem3
//
this.menuItem3.Text = "Sincronizar Cortes";
//
// SistemasEtiquetas
//
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(322, 348);
this.Menu = this.mainMenu1;
this.Text = "Sistema de Eitquetas";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
}
开发者ID:devxsid69,项目名称:LP-Lavanderia,代码行数:37,代码来源:SDASistEti.cs
示例3: OnLoad
protected override void OnLoad(EventArgs e)
{
var menu = new MainMenu();
MenuItem open = new MenuItem("Open", (s, a) =>
{
using (var dialog = new OpenFileDialogAdapter())
{
dialog.InitialDirectory = "/tmp";
if (dialog.ShowDialog() == DialogResult.OK)
{
m_datafile = new FileInfo(dialog.FileName);
m_painted = false;
}
}
});
MenuItem refresh = new MenuItem("Refresh", (s, a) =>
{
m_painted = false;
this.Invalidate();
});
base.OnLoad(e);
menu.MenuItems.Add(open);
menu.MenuItems.Add(refresh);
Menu = menu;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:28,代码来源:VwGraphicsReplayer.cs
示例4: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panelBottom = new System.Windows.Forms.Panel();
this.grid = new SourceGrid.Grid();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.mnWindow = new System.Windows.Forms.MenuItem();
this.panelBottom.SuspendLayout();
this.SuspendLayout();
//
// panelBottom
//
this.panelBottom.BackColor = System.Drawing.SystemColors.ControlDark;
this.panelBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelBottom.Controls.Add(this.grid);
this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelBottom.Location = new System.Drawing.Point(0, 342);
this.panelBottom.Name = "panelBottom";
this.panelBottom.Size = new System.Drawing.Size(772, 128);
this.panelBottom.TabIndex = 1;
//
// grid
//
this.grid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.grid.AutoStretchColumnsToFitWidth = false;
this.grid.AutoStretchRowsToFitHeight = false;
this.grid.BackColor = System.Drawing.SystemColors.Window;
this.grid.CustomSort = false;
this.grid.Location = new System.Drawing.Point(0, 4);
this.grid.Name = "grid";
this.grid.OverrideCommonCmdKey = true;
this.grid.Size = new System.Drawing.Size(768, 120);
this.grid.SpecialKeys = SourceGrid.GridSpecialKeys.Default;
this.grid.TabIndex = 0;
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnWindow});
//
// mnWindow
//
this.mnWindow.Index = 0;
this.mnWindow.Text = "Window";
//
// frmSample25
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(772, 470);
this.Controls.Add(this.panelBottom);
this.IsMdiContainer = true;
this.Menu = this.mainMenu1;
this.Name = "frmSample25";
this.Text = "frmSample25";
this.Load += new System.EventHandler(this.frmSample25_Load);
this.panelBottom.ResumeLayout(false);
this.ResumeLayout(false);
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:64,代码来源:frmSample25.cs
示例5: MainForm
public MainForm()
{
defaultInstance = this;
UpdateText();
listBox.Dock = DockStyle.Fill;
listBox.SelectedValueChanged += new EventHandler(listBox_SelectedValueChanged);
splitContainer.Panel1.Controls.Add(listBox);
propertyGrid.Dock = DockStyle.Fill;
propertyGrid.HelpVisible = false;
propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(
propertyGrid_PropertyValueChanged);
splitContainer.Panel2.Controls.Add(propertyGrid);
splitContainer.Dock = DockStyle.Fill;
Controls.Add(splitContainer);
MenuItem fileMenu = new MenuItem("&File");
fileMenu.MenuItems.Add(new MenuItem("&Open", open_Click));
fileMenu.MenuItems.Add(new MenuItem("&Save", save_Click));
fileMenu.MenuItems.Add(new MenuItem("E&xit",
delegate(object sender, EventArgs args) { Close(); }));
MenuItem editMenu = new MenuItem("&Edit");
editMenu.MenuItems.Add(new MenuItem("&Add entry", addEntry_Click));
editMenu.MenuItems.Add(new MenuItem("&Remove entry", removeEntry_Click));
Menu = new MainMenu(new MenuItem[] { fileMenu, editMenu });
DataBindings.Add(new Binding("Size", settings, "FormSize"));
DataBindings.Add(new Binding("Location", settings, "FormLocation"));
}
开发者ID:jaggedsoft,项目名称:aesirtk,代码行数:26,代码来源:MainForm.cs
示例6: VBScriptTemplate
namespace MyGeneration
{
/// <summary>
/// Summary description for VBScriptTemplate.
/// </summary>
public class VBScriptTemplate : ScriptWindow
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem Script;
private System.Windows.Forms.MenuItem ScriptGenerate;
private ScintillaControl scintillaControl = null;
public VBScriptTemplate()
{
InitializeComponent();
scintillaControl = new ZeusScintillaControl(ScriptLanguage.VBScript);
scintillaControl.AddShortcutsFromForm(this);
this.Controls.Add(scintillaControl);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
protected override ScintillaControl ScintillaControl
{
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:39,代码来源:VBScriptTemplate.cs
示例7: Transformer
public Transformer()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
Text = "COMP 4560: Assignment 5 (201230) Joseph Krump";
ResizeRedraw = true;
BackColor = Color.Black;
MenuItem miNewDat = new MenuItem("New &Data...",
new EventHandler(MenuNewDataOnClick));
MenuItem miExit = new MenuItem("E&xit",
new EventHandler(MenuFileExitOnClick));
MenuItem miDash = new MenuItem("-");
MenuItem miFile = new MenuItem("&File",
new MenuItem[] {miNewDat, miDash, miExit});
MenuItem miAbout = new MenuItem("&About",
new EventHandler(MenuAboutOnClick));
Menu = new MainMenu(new MenuItem[] {miFile, miAbout});
refresh += InvalidateWindow;
}
开发者ID:joekrump,项目名称:ComputerGraphics_COMP4560,代码行数:25,代码来源:Form1.cs
示例8: StatusForm
internal StatusForm(StatusMonitor statusMonitor, BrowserIntegration browserIntegration, PreferenceStore preferenceStore)
{
this.browserIntegration = browserIntegration;
this.preferenceStore = preferenceStore;
this.statusMonitor = statusMonitor;
statusMonitor.DataLoaded += onXmlDataLoaded;
preferences = preferenceStore.Load();
MenuItem settingsMenuItem = new MenuItem("Settings...", new EventHandler(onSettingsClicked));
MenuItem separatorMenuItem = new MenuItem("-");
MenuItem exitMenuItem = new MenuItem("Exit", new EventHandler(onMenuExitClick));
MenuItem fileMenu = new MenuItem("File", new MenuItem[] { settingsMenuItem, separatorMenuItem, exitMenuItem });
MainMenu mainMenu = new MainMenu(new MenuItem[] {fileMenu});
this.Menu = mainMenu;
// .NET 1.1 compat
EventInfo formClosingEvent = GetType().GetEvent("FormClosing");
if (formClosingEvent != null)
{
formClosingEvent.AddEventHandler(this, new FormClosingEventHandler(this.onClosing));
}
InitializeComponent();
configure();
timer.Enabled = true;
}
开发者ID:majianxiong,项目名称:vulcan,代码行数:31,代码来源:StatusForm.cs
示例9: InitializeComponent
private void InitializeComponent()
{
this.Text = "Jump to buffer";
ColumnHeader columnHeader = new ColumnHeader();
columnHeader.Text = "Buffer";
this.bufferlistview = new ListView();
this.bufferlistview.View = View.Details;
this.bufferlistview.HeaderStyle = ColumnHeaderStyle.Nonclickable;
this.bufferlistview.FullRowSelect = true;
this.bufferlistview.Dock = DockStyle.Fill;
this.bufferlistview.Columns.Add(columnHeader);
this.bufferlistview.SelectedIndexChanged += this.BufferListView_SelectedIndexChanged;
this.Controls.Add(this.bufferlistview);
MainMenu menu = new MainMenu();
this.Menu = menu;
MenuItem select = new MenuItem();
select.Text = "Select buffer";
select.Click += this.Select_Click;
menu.MenuItems.Add(select);
MenuItem cancel = new MenuItem();
cancel.Text = "Cancel";
cancel.Click += this.Cancel_Click;
menu.MenuItems.Add(cancel);
}
开发者ID:txanatan,项目名称:KitChat,代码行数:29,代码来源:JumpToBufferDialog.cs
示例10: MainForm
public MainForm()
{
ClientSize = new Size(640, 480);
ShowIcon = false;
FilePath = "";
fileType = FileType.XML;
Menu = new MainMenu();
CreateMenu();
BrowserSettings browserSettings = new BrowserSettings() {
HistoryDisabled = true,
FixedFontFamily = FontFamily.GenericMonospace.Name,
DefaultFontSize = 12,
DefaultFixedFontSize = 8
};
webView = new WebView("http://internal/res/index.html", browserSettings) {
Dock = DockStyle.Fill,
RequestHandler = new ManifestResourceHandler() {
culture = Thread.CurrentThread.CurrentCulture
},
LifeSpanHandler = new ExternalLifeSpanHandler(),
JsDialogHandler = new WebViewDialogHandler(this)
};
webView.PropertyChanged += WebViewTitleChanged;
this.Controls.Add(webView);
CEF.RegisterJsObject("win", ctrl = new FormControlObject(this));
ctrl.OnDataArrive += OnDataArrive;
}
开发者ID:JLChnToZ,项目名称:BlockEditorTest,代码行数:33,代码来源:MainForm.cs
示例11: AddMenu
public void AddMenu()
{
MainMenu mnuFileMenu = new MainMenu();
option = new MenuItem("&Options");
hlp = new MenuItem("&Help");
aboutDev = new MenuItem("&About Developers");
nGame = new MenuItem("&New Game");
ext = new MenuItem("&Exit");
advanced = new MenuItem("&Show/Hide Developer Console");
advanced.Shortcut = System.Windows.Forms.Shortcut.F1;
mnuFileMenu.MenuItems.Add(option);
mnuFileMenu.MenuItems.Add(hlp);
hlp.MenuItems.Add(aboutDev);
option.MenuItems.Add(nGame);
option.MenuItems.Add(advanced);
option.MenuItems.Add(ext);
nGame.Click += new System.EventHandler(this.menuItems_onClick);
ext.Click += new System.EventHandler(this.menuItems_onClick);
aboutDev.Click += new System.EventHandler(this.menuItems_onClick);
advanced.Click += new System.EventHandler(this.menuItems_onClick);
this.Menu = mnuFileMenu;
}
开发者ID:ayazali,项目名称:ConnectFour,代码行数:26,代码来源:Form1.cs
示例12: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.mainMenu = new System.Windows.Forms.MainMenu();
this.menuFile = new System.Windows.Forms.MenuItem();
this.menuFileExit = new System.Windows.Forms.MenuItem();
//
// mainMenu
//
this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuFile});
//
// menuFile
//
this.menuFile.Index = 0;
this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuFileExit});
this.menuFile.Text = "File";
//
// menuFileExit
//
this.menuFileExit.Index = 0;
this.menuFileExit.Text = "Exit";
this.menuFileExit.Click += new System.EventHandler(this.menuFileExit_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(528, 325);
this.MaximizeBox = false;
this.Menu = this.mainMenu;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sea War Advanced";
}
开发者ID:maxya,项目名称:old_sources,代码行数:38,代码来源:Form1.cs
示例13: MyWindow
public MyWindow()
: base()
{
Menu = new MainMenu();
Menu.MenuItems.Add("File");
Menu.MenuItems.Add("Edit");
Menu.MenuItems.Add("View");
Menu.MenuItems.Add("Help");
Bitmap bm = new Bitmap(GetType(), "SimpleToolbar.bmp");
ImageList imglist = new ImageList();
imglist.Images.AddStrip(bm);
imglist.TransparentColor = Color.LightBlue;
ToolBar tb = new ToolBar();
tb.Parent = this;
tb.ShowToolTips = true;
string[] astr = { "New", "Open", "Save", "Print", "Cut", "Copy", "Paste" };
for (int i = 0; i < 7; i++)
{
ToolBarButton tbb = new ToolBarButton();
tbb.ImageIndex = i;
tbb.ToolTipText = astr[i];
tb.Buttons.Add(tbb);
}
}
开发者ID:kmrashish,项目名称:DotNetLab,代码行数:25,代码来源:Program.cs
示例14: Transformer
public Transformer()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
Text = "COMP 4560: Assignment 5 (200830) (Your Name Here)";
ResizeRedraw = true;
BackColor = Color.Black;
MenuItem miNewDat = new MenuItem("New &Data...",
new EventHandler(MenuNewDataOnClick));
MenuItem miExit = new MenuItem("E&xit",
new EventHandler(MenuFileExitOnClick));
MenuItem miDash = new MenuItem("-");
MenuItem miFile = new MenuItem("&File",
new MenuItem[] {miNewDat, miDash, miExit});
MenuItem miAbout = new MenuItem("&About",
new EventHandler(MenuAboutOnClick));
Menu = new MainMenu(new MenuItem[] {miFile, miAbout});
}
开发者ID:JensErikChristiansen,项目名称:comp4560a5,代码行数:27,代码来源:Form1.cs
示例15: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "ModelEditor";
m_Closed = false;
m_FileName = string.Empty;
m_PerspectiveView = new PerspectiveViewControl( );
m_PerspectiveView.Dock = System.Windows.Forms.DockStyle.Fill;
m_PerspectiveView.Location = new System.Drawing.Point( 100, 100 );
m_MainMenu = new MainMenu( );
m_FileMenu = new MenuItem( "&File" );
m_FileOpen = new MenuItem( "&Open",
this.FileOpen, Shortcut.CtrlO );
m_MainMenu.MenuItems.Add( m_FileMenu );
m_FileMenu.MenuItems.Add( m_FileOpen );
this.Menu = m_MainMenu;
this.SuspendLayout( );
this.Controls.Add( m_PerspectiveView );
this.ResumeLayout( );
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( ModelEditor_FormClosing );
}
开发者ID:RedRingRico,项目名称:BloodBullet-Editor,代码行数:36,代码来源:ModelEditor.Designer.cs
示例16: SkillSimulatorMainGUI
//SQLLinker sqlinker = new SQLLinker();
public SkillSimulatorMainGUI()
{
InitializeComponent();
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
Graph = new GraphManager();
menu = new MainMenu();
PrevSelectedJob = SelectedJob = "";
}
开发者ID:ruxeom,项目名称:RO-Skill-Simulator,代码行数:9,代码来源:SkillSimulatorMainGUI.cs
示例17: GetMainMenuTest
public void GetMainMenuTest ()
{
MainMenu mymainmenu = new MainMenu ();
MenuItem mymenuitem = new MenuItem ();
mymenuitem.Text = "menu 1";
mymainmenu.MenuItems.Add (mymenuitem);
Assert.AreEqual (mymainmenu, mymenuitem.GetMainMenu (), "#7");
}
开发者ID:Profit0004,项目名称:mono,代码行数:8,代码来源:MenuTest.cs
示例18: PrintThreePages
public PrintThreePages()
{
Text = "Print Three Pages";
Menu = new MainMenu();
Menu.MenuItems.Add("&File");
Menu.MenuItems[0].MenuItems.Add("&Print...",
new EventHandler(MenuFilePrintOnClick));
}
开发者ID:xs2ranjeet,项目名称:13ns9-1spr,代码行数:8,代码来源:PrintThreePages.cs
示例19: AddMenu
public void AddMenu()
{
MainMenu mnuFuturesContractsMenu = new MainMenu();
this.Menu = mnuFuturesContractsMenu;
MenuItem FuturesContracts = new MenuItem("&FuturesContracts");
MenuItem addNextExistingContracts = new MenuItem("&Add Next/Edit Existing Contracts");
MenuItem createNewContract = new MenuItem("&Create a new contract");
}
开发者ID:pwang-prm,项目名称:ViewModelController,代码行数:8,代码来源:Form1.cs
示例20: BaseMenuBuilder
public BaseMenuBuilder(MainMenu aMainMenu,
MenuItem aParent,
MenuItem aBefore,
MenuItem aAfter)
: base(aMainMenu, aParent, aBefore, aAfter)
{
InitializeComponent();
}
开发者ID:nfan,项目名称:Jaxer,代码行数:8,代码来源:MenuBuilder.cs
注:本文中的System.Windows.Forms.MainMenu类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论