[2008] Mainmenu1 & InitializeComponent()
Hi All,
I have a wierd problem where everytime I add a mainmenu I have to edit InitializeComponent().
I tried to take a shortcut and copy an existing menu and then rename it. Big mistake. If you have done it, do not do it again.
Anyone have an idea of how to get me back on track?
I have done a rebuild, closed VB etc.:confused:
Code:
'frmMain
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.AutoSize = True
Me.ClientSize = New System.Drawing.Size(902, 513)
Me.Controls.Add(Me.ToolBar2)
Me.Controls.Add(Me.ToolBar1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.IsMdiContainer = True
Me.Menu = Me.MainMenu1
Me.Name = "frmMain"
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
Me.ResumeLayout(False)
Me.PerformLayout()
Re: [2008] Mainmenu1 & InitializeComponent()
Re: [2008] Mainmenu1 & InitializeComponent()
You say you have to edit IntiializeComponent but you don't tell us why or what edit(s) you have to make. You also ask how to get back on track but you haven't actually said what exactly is currently off track. Are you saying, without actually saying, that your form won't display in the designer, or that your project won't build, or both, or something else?
I would think that the thing to do would be to simply delete the variable declaration from your designer code file and then the compiler will flag every place that that variable is used, which you can then delete.
Also, is there a particular reason you're using a MainMenu instead of a MenuStrip?
Re: [2008] Mainmenu1 & InitializeComponent()
I guess I did leave that part out.
The form loads. What does not load is the main menu but instead the new menu I just created. So, I have to make an edit and change it back to me.MainMenu1