473,466 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

main menu disappearred

GS
the main menu in the application seemed to disappeared all together until I
click on an control and select mainmenu1 in designer. then the mainmenu1
displays where it should be but running it or deselecting the mainmenu1, the
menu disappears again.
what can I do. to fix the problem
Oct 18 '06 #1
17 2322
Explain a little bit please, are you running/debugging? Are you designing?

--
Thiele Enterprises - The Power Is In Your Hands Now!
Oct 19 '06 #2
gs
thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then see
the main menu. if the current control is no men menu, I will not see main
menu in designer.

2. when running, no main menu either

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:8vBZg.5891$IW6.4606@trndny01...
Explain a little bit please, are you running/debugging? Are you designing?

--
Thiele Enterprises - The Power Is In Your Hands Now!

Oct 19 '06 #3
Have you restarted VS? Or, your computer?
Have you tried creating a new form and placing a main menu on that?
Sometimes VS has hicups when your program gets big.
Do you use VS2003 or VS 2005?

--
Thiele Enterprises - The Power Is In Your Hands Now!
Oct 19 '06 #4

gs schrieb:
thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then see
the main menu. if the current control is no men menu, I will not see main
menu in designer.

2. when running, no main menu either
Is it possible that you accidentally "hide" your Mainmenu behind some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to create
this problem...

Oct 19 '06 #5
gs

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:61CZg.5448$5v5.2421@trndny08...
Have you restarted VS? Or, your computer?
Yes both
Have you tried creating a new form and placing a main menu on that?
in the same project or different project?
Sometimes VS has hicups when your program gets big.
is 107kb big? I have 2 GB of ram. about 850GB of commit/charge useage
between VS2005 express and a running virtual PC
I even trying running VS only after reboot still messed up the main menu. I
guess there is no way it will let me add nother main menu on other form in
teh project. it is possible to add a menu strip to another form
Do you use VS2003 or VS 2005?
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: VB Express

Microsoft Visual Basic 2005 76541-000-0000011-.....
Microsoft Visual Basic 2005

Hmmm, actually I don't see any way to add mainmenu through the designer. no
mainmenu but "menu" in the toolbox.
If I start up a new prject, I don't see main menu either even in code as
system.windows.form..mainmenu

I believe there was an dotnet update not too long ago
>
--
Thiele Enterprises - The Power Is In Your Hands Now!

Oct 19 '06 #6
gs
thank you for your patience.

I thought about this. but if hidden then only behind the form. I was
looking at the attribute to bring forward but failed.

when I don't see the main menu in designer, click on he spot where the main
menu should be and select property, I got the main form shown in the
property box.

So, how do I unhide the main menu?

"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
gs schrieb:
>thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then
see
the main menu. if the current control is no men menu, I will not see main
menu in designer.

2. when running, no main menu either

Is it possible that you accidentally "hide" your Mainmenu behind some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to create
this problem...

Oct 19 '06 #7
gs
oh, btw, I went to code and extract the code for mainenu
'Required by the Windows Form Designer

Private components As System.Component.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

....
<System.Diagnostics.DebuggerStepThrough()Private Sub InitializeComponent()

Me.components = New System.ComponentModel.Container

Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))

Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)

Me.fileMI = New System.Windows.Forms.MenuItem

Me.openMI = New System.Windows.Forms.MenuItem

Me.printMI = New System.Windows.Forms.MenuItem

Me.MenuItem6 = New System.Windows.Forms.MenuItem

Me.exitMI = New System.Windows.Forms.MenuItem

Me.editMI = New System.Windows.Forms.MenuItem

Me.cutMI = New System.Windows.Forms.MenuItem

Me.copyMI = New System.Windows.Forms.MenuItem

Me.pasteMI = New System.Windows.Forms.MenuItem

Me.MenuItem12 = New System.Windows.Forms.MenuItem

Me.findMI = New System.Windows.Forms.MenuItem

Me.viewSourceMI = New System.Windows.Forms.MenuItem

Me.toolsMI = New System.Windows.Forms.MenuItem

Me.internetOptionsMI = New System.Windows.Forms.MenuItem

Me.helpMI = New System.Windows.Forms.MenuItem

Me.aboutMI = New System.Windows.Forms.MenuItem

Me.contextMenu = New System.Windows.Forms.ContextMenu

....

'MainMenu1

'

Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI, Me.helpMI})

'

'fileMI

'

Me.fileMI.Index = 0

Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.openMI,
Me.printMI, Me.MenuItem6, Me.exitMI})

Me.fileMI.Text = "File"

'

'openMI

'

Me.openMI.Index = 0

Me.openMI.Text = "&Open..."

'

'printMI

'

Me.printMI.Index = 1

Me.printMI.Text = "&Print..."

.......

"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
gs schrieb:
>thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then
see
the main menu. if the current control is no men menu, I will not see main
menu in designer.

2. when running, no main menu either

Is it possible that you accidentally "hide" your Mainmenu behind some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to create
this problem...

Oct 19 '06 #8
it looks as if the menu is not included in the controlcolleciton.

Find a line the says something close to:

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl})

If your menu is not listed in the control collection, add it manually.

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl,
MyMenuControl})
See if this helps....

--
Thiele Enterprises - The Power Is In Your Hands Now!
"gs" <gs@dontMail.teluswrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
oh, btw, I went to code and extract the code for mainenu
'Required by the Windows Form Designer

Private components As System.Component.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

...
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()

Me.components = New System.ComponentModel.Container

Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))

Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)

Me.fileMI = New System.Windows.Forms.MenuItem

Me.openMI = New System.Windows.Forms.MenuItem

Me.printMI = New System.Windows.Forms.MenuItem

Me.MenuItem6 = New System.Windows.Forms.MenuItem

Me.exitMI = New System.Windows.Forms.MenuItem

Me.editMI = New System.Windows.Forms.MenuItem

Me.cutMI = New System.Windows.Forms.MenuItem

Me.copyMI = New System.Windows.Forms.MenuItem

Me.pasteMI = New System.Windows.Forms.MenuItem

Me.MenuItem12 = New System.Windows.Forms.MenuItem

Me.findMI = New System.Windows.Forms.MenuItem

Me.viewSourceMI = New System.Windows.Forms.MenuItem

Me.toolsMI = New System.Windows.Forms.MenuItem

Me.internetOptionsMI = New System.Windows.Forms.MenuItem

Me.helpMI = New System.Windows.Forms.MenuItem

Me.aboutMI = New System.Windows.Forms.MenuItem

Me.contextMenu = New System.Windows.Forms.ContextMenu

...

'MainMenu1

'

Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI, Me.helpMI})

'

'fileMI

'

Me.fileMI.Index = 0

Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.openMI, Me.printMI, Me.MenuItem6, Me.exitMI})

Me.fileMI.Text = "File"

'

'openMI

'

Me.openMI.Index = 0

Me.openMI.Text = "&Open..."

'

'printMI

'

Me.printMI.Index = 1

Me.printMI.Text = "&Print..."

......

"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>>
gs schrieb:
>>thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then
see
the main menu. if the current control is no men menu, I will not see
main
menu in designer.

2. when running, no main menu either

Is it possible that you accidentally "hide" your Mainmenu behind some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to create
this problem...


Oct 20 '06 #9
GS
Thank you.

unfortunately Me.Controls.AddRange(MainMenu1)
leads to error:
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be converted to
'1-dimensional array of System.Windows.Forms.Control'. ...myform.vb 1284 30
myform

actually there is no prior me.control.addrange but quite a number of
me.controls.add(...)
none for me.mainmenu1
if I use add instead of addrange
Me.Controls.Add(MainMenu1)
I get similar message like using addrange.

btw, I am using visual basic .net 2005 express with latest update. the
project initially upgraded an webICHpstCtrl demo project from prior version
(.net 1?). The main menu was visible both in designer and in run time. I
had ripped out the ole webbrowser component and replaced with an more .net
interface webbrowser.
There was and there still is not separate designer file for myform.

If I create a new project, I will not see any guid component the main code
file but see the in the designer file. that is I end up with 2 partial
classes

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:UzWZg.7064$Z46.4151@trndny05...
it looks as if the menu is not included in the controlcolleciton.

Find a line the says something close to:

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl})

If your menu is not listed in the control collection, add it manually.

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl,
MyMenuControl})
See if this helps....

--
Thiele Enterprises - The Power Is In Your Hands Now!
"gs" <gs@dontMail.teluswrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
oh, btw, I went to code and extract the code for mainenu
'Required by the Windows Form Designer

Private components As System.Component.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

...
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()

Me.components = New System.ComponentModel.Container

Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))

Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)

Me.fileMI = New System.Windows.Forms.MenuItem

Me.openMI = New System.Windows.Forms.MenuItem

Me.printMI = New System.Windows.Forms.MenuItem

Me.MenuItem6 = New System.Windows.Forms.MenuItem

Me.exitMI = New System.Windows.Forms.MenuItem

Me.editMI = New System.Windows.Forms.MenuItem

Me.cutMI = New System.Windows.Forms.MenuItem

Me.copyMI = New System.Windows.Forms.MenuItem

Me.pasteMI = New System.Windows.Forms.MenuItem

Me.MenuItem12 = New System.Windows.Forms.MenuItem

Me.findMI = New System.Windows.Forms.MenuItem

Me.viewSourceMI = New System.Windows.Forms.MenuItem

Me.toolsMI = New System.Windows.Forms.MenuItem

Me.internetOptionsMI = New System.Windows.Forms.MenuItem

Me.helpMI = New System.Windows.Forms.MenuItem

Me.aboutMI = New System.Windows.Forms.MenuItem

Me.contextMenu = New System.Windows.Forms.ContextMenu

...

'MainMenu1

'

Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI,
Me.helpMI})

'

'fileMI

'

Me.fileMI.Index = 0

Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.openMI, Me.printMI, Me.MenuItem6, Me.exitMI})

Me.fileMI.Text = "File"

'

'openMI

'

Me.openMI.Index = 0

Me.openMI.Text = "&Open..."

'

'printMI

'

Me.printMI.Index = 1

Me.printMI.Text = "&Print..."

......

"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
gs schrieb:

thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then
see
the main menu. if the current control is no men menu, I will not see
main
menu in designer.

2. when running, no main menu either
Is it possible that you accidentally "hide" your Mainmenu behind some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to create
this problem...


Oct 20 '06 #10
to use the addrange method, you have to declare an instance.

Controls.AddRange(New MainMenu() {MainMenu1})

you can also use:

Controls.Add(MainMenu1)

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Thank you.

unfortunately Me.Controls.AddRange(MainMenu1)
leads to error:
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be converted to
'1-dimensional array of System.Windows.Forms.Control'. ...myform.vb 1284 30
myform

actually there is no prior me.control.addrange but quite a number of
me.controls.add(...)
none for me.mainmenu1
if I use add instead of addrange
Me.Controls.Add(MainMenu1)
I get similar message like using addrange.

btw, I am using visual basic .net 2005 express with latest update. the
project initially upgraded an webICHpstCtrl demo project from prior version
(.net 1?). The main menu was visible both in designer and in run time. I
had ripped out the ole webbrowser component and replaced with an more .net
interface webbrowser.
There was and there still is not separate designer file for myform.

If I create a new project, I will not see any guid component the main code
file but see the in the designer file. that is I end up with 2 partial
classes

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:UzWZg.7064$Z46.4151@trndny05...
it looks as if the menu is not included in the controlcolleciton.

Find a line the says something close to:

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl})

If your menu is not listed in the control collection, add it manually.

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl,
MyMenuControl})
See if this helps....

--
Thiele Enterprises - The Power Is In Your Hands Now!
"gs" <gs@dontMail.teluswrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
oh, btw, I went to code and extract the code for mainenu
'Required by the Windows Form Designer

Private components As System.Component.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

...
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()

Me.components = New System.ComponentModel.Container

Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))

Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)

Me.fileMI = New System.Windows.Forms.MenuItem

Me.openMI = New System.Windows.Forms.MenuItem

Me.printMI = New System.Windows.Forms.MenuItem

Me.MenuItem6 = New System.Windows.Forms.MenuItem

Me.exitMI = New System.Windows.Forms.MenuItem

Me.editMI = New System.Windows.Forms.MenuItem

Me.cutMI = New System.Windows.Forms.MenuItem

Me.copyMI = New System.Windows.Forms.MenuItem

Me.pasteMI = New System.Windows.Forms.MenuItem

Me.MenuItem12 = New System.Windows.Forms.MenuItem

Me.findMI = New System.Windows.Forms.MenuItem

Me.viewSourceMI = New System.Windows.Forms.MenuItem

Me.toolsMI = New System.Windows.Forms.MenuItem

Me.internetOptionsMI = New System.Windows.Forms.MenuItem

Me.helpMI = New System.Windows.Forms.MenuItem

Me.aboutMI = New System.Windows.Forms.MenuItem

Me.contextMenu = New System.Windows.Forms.ContextMenu

...

'MainMenu1

'

Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI,
Me.helpMI})

'

'fileMI

'

Me.fileMI.Index = 0

Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.openMI, Me.printMI, Me.MenuItem6, Me.exitMI})

Me.fileMI.Text = "File"

'

'openMI

'

Me.openMI.Index = 0

Me.openMI.Text = "&Open..."

'

'printMI

'

Me.printMI.Index = 1

Me.printMI.Text = "&Print..."

......

"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
gs schrieb:

thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then
see
the main menu. if the current control is no men menu, I will not see
main
menu in designer.

2. when running, no main menu either
Is it possible that you accidentally "hide" your Mainmenu behind some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to create
this problem...



Oct 20 '06 #11
If you add more then one control you can use the addrange method, forgot to
add this...

Controls.Addrange({Control1,Control2,etc})

Or you can add them one at a time.

Controls.Add(Control1)
Controls.Add(Control2)
etc...
--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Thank you.

unfortunately Me.Controls.AddRange(MainMenu1)
leads to error:
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be converted to
'1-dimensional array of System.Windows.Forms.Control'. ...myform.vb 1284 30
myform

actually there is no prior me.control.addrange but quite a number of
me.controls.add(...)
none for me.mainmenu1
if I use add instead of addrange
Me.Controls.Add(MainMenu1)
I get similar message like using addrange.

btw, I am using visual basic .net 2005 express with latest update. the
project initially upgraded an webICHpstCtrl demo project from prior version
(.net 1?). The main menu was visible both in designer and in run time. I
had ripped out the ole webbrowser component and replaced with an more .net
interface webbrowser.
There was and there still is not separate designer file for myform.

If I create a new project, I will not see any guid component the main code
file but see the in the designer file. that is I end up with 2 partial
classes

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:UzWZg.7064$Z46.4151@trndny05...
it looks as if the menu is not included in the controlcolleciton.

Find a line the says something close to:

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl})

If your menu is not listed in the control collection, add it manually.

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl,
MyMenuControl})
See if this helps....

--
Thiele Enterprises - The Power Is In Your Hands Now!
"gs" <gs@dontMail.teluswrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
oh, btw, I went to code and extract the code for mainenu
'Required by the Windows Form Designer

Private components As System.Component.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

...
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()

Me.components = New System.ComponentModel.Container

Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))

Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)

Me.fileMI = New System.Windows.Forms.MenuItem

Me.openMI = New System.Windows.Forms.MenuItem

Me.printMI = New System.Windows.Forms.MenuItem

Me.MenuItem6 = New System.Windows.Forms.MenuItem

Me.exitMI = New System.Windows.Forms.MenuItem

Me.editMI = New System.Windows.Forms.MenuItem

Me.cutMI = New System.Windows.Forms.MenuItem

Me.copyMI = New System.Windows.Forms.MenuItem

Me.pasteMI = New System.Windows.Forms.MenuItem

Me.MenuItem12 = New System.Windows.Forms.MenuItem

Me.findMI = New System.Windows.Forms.MenuItem

Me.viewSourceMI = New System.Windows.Forms.MenuItem

Me.toolsMI = New System.Windows.Forms.MenuItem

Me.internetOptionsMI = New System.Windows.Forms.MenuItem

Me.helpMI = New System.Windows.Forms.MenuItem

Me.aboutMI = New System.Windows.Forms.MenuItem

Me.contextMenu = New System.Windows.Forms.ContextMenu

...

'MainMenu1

'

Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI,
Me.helpMI})

'

'fileMI

'

Me.fileMI.Index = 0

Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.openMI, Me.printMI, Me.MenuItem6, Me.exitMI})

Me.fileMI.Text = "File"

'

'openMI

'

Me.openMI.Index = 0

Me.openMI.Text = "&Open..."

'

'printMI

'

Me.printMI.Index = 1

Me.printMI.Text = "&Print..."

......

"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
gs schrieb:

thanks
both.
1
in design mode, the main menu does not show up. Unless I click on any
control to select property,, and then scroll to Mainmenu1, I will then
see
the main menu. if the current control is no men menu, I will not see
main
menu in designer.

2. when running, no main menu either
Is it possible that you accidentally "hide" your Mainmenu behind some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to create
this problem...



Oct 20 '06 #12
GS
thank you your patience
however

Controls.Add(MainMenu1)
yields compiler error of
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be
converted to 'System.Windows.Forms.Control'.

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:ybZZg.4621$kG5.2814@trndny07...
to use the addrange method, you have to declare an instance.

Controls.AddRange(New MainMenu() {MainMenu1})

you can also use:

Controls.Add(MainMenu1)

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Thank you.

unfortunately Me.Controls.AddRange(MainMenu1)
leads to error:
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be converted
to
'1-dimensional array of System.Windows.Forms.Control'. ...myform.vb 1284
30
myform

actually there is no prior me.control.addrange but quite a number of
me.controls.add(...)
none for me.mainmenu1
if I use add instead of addrange
Me.Controls.Add(MainMenu1)
I get similar message like using addrange.

btw, I am using visual basic .net 2005 express with latest update. the
project initially upgraded an webICHpstCtrl demo project from prior
version
(.net 1?). The main menu was visible both in designer and in run time. I
had ripped out the ole webbrowser component and replaced with an more
..net
interface webbrowser.
There was and there still is not separate designer file for myform.

If I create a new project, I will not see any guid component the main code
file but see the in the designer file. that is I end up with 2 partial
classes

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:UzWZg.7064$Z46.4151@trndny05...
it looks as if the menu is not included in the controlcolleciton.

Find a line the says something close to:

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl})

If your menu is not listed in the control collection, add it manually.

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl,
MyMenuControl})
See if this helps....

--
Thiele Enterprises - The Power Is In Your Hands Now!
"gs" <gs@dontMail.teluswrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
oh, btw, I went to code and extract the code for mainenu
>
>
'Required by the Windows Form Designer
>
Private components As System.Component.IContainer
>
'NOTE: The following procedure is required by the Windows Form
Designer
>
'It can be modified using the Windows Form Designer.
>
'Do not modify it using the code editor.
>
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
>
...
>
>
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()
>
Me.components = New System.ComponentModel.Container
>
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))
>
Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)
>
Me.fileMI = New System.Windows.Forms.MenuItem
>
Me.openMI = New System.Windows.Forms.MenuItem
>
Me.printMI = New System.Windows.Forms.MenuItem
>
Me.MenuItem6 = New System.Windows.Forms.MenuItem
>
Me.exitMI = New System.Windows.Forms.MenuItem
>
Me.editMI = New System.Windows.Forms.MenuItem
>
Me.cutMI = New System.Windows.Forms.MenuItem
>
Me.copyMI = New System.Windows.Forms.MenuItem
>
Me.pasteMI = New System.Windows.Forms.MenuItem
>
Me.MenuItem12 = New System.Windows.Forms.MenuItem
>
Me.findMI = New System.Windows.Forms.MenuItem
>
Me.viewSourceMI = New System.Windows.Forms.MenuItem
>
Me.toolsMI = New System.Windows.Forms.MenuItem
>
Me.internetOptionsMI = New System.Windows.Forms.MenuItem
>
Me.helpMI = New System.Windows.Forms.MenuItem
>
Me.aboutMI = New System.Windows.Forms.MenuItem
>
Me.contextMenu = New System.Windows.Forms.ContextMenu
>
...
>
'MainMenu1
>
'
>
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI,
Me.helpMI})
>
'
>
'fileMI
>
'
>
Me.fileMI.Index = 0
>
Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.openMI, Me.printMI, Me.MenuItem6, Me.exitMI})
>
Me.fileMI.Text = "File"
>
'
>
'openMI
>
'
>
Me.openMI.Index = 0
>
Me.openMI.Text = "&Open..."
>
'
>
'printMI
>
'
>
Me.printMI.Index = 1
>
Me.printMI.Text = "&Print..."
>
......
>
"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
>>
>gs schrieb:
>>
>>thanks
>>both.
>>1
>>in design mode, the main menu does not show up. Unless I click on
any
>>control to select property,, and then scroll to Mainmenu1, I will
then
>>see
>>the main menu. if the current control is no men menu, I will not see
>>main
>>menu in designer.
>>>
>>2. when running, no main menu either
>>>
>>
>Is it possible that you accidentally "hide" your Mainmenu behind some
>other Controls or Containers (A Panel, GroupBox or whatever)?
>Stupid question, I know - But this was the only way for me to create
>this problem...
>>
>
>



Oct 20 '06 #13
Strange that that happens since the MainMenu is derived from a control....

Have you tried this code...

Me.Controls.AddRange(New Control() {Me.MainMenu1})

Actually am suprised that you don't have MainMenuStrip control.
--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:u$**************@TK2MSFTNGP06.phx.gbl...
thank you your patience
however

Controls.Add(MainMenu1)
yields compiler error of
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be
converted to 'System.Windows.Forms.Control'.

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:ybZZg.4621$kG5.2814@trndny07...
to use the addrange method, you have to declare an instance.

Controls.AddRange(New MainMenu() {MainMenu1})

you can also use:

Controls.Add(MainMenu1)

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Thank you.

unfortunately Me.Controls.AddRange(MainMenu1)
leads to error:
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be converted
to
'1-dimensional array of System.Windows.Forms.Control'. ...myform.vb 1284
30
myform

actually there is no prior me.control.addrange but quite a number of
me.controls.add(...)
none for me.mainmenu1
if I use add instead of addrange
Me.Controls.Add(MainMenu1)
I get similar message like using addrange.

btw, I am using visual basic .net 2005 express with latest update. the
project initially upgraded an webICHpstCtrl demo project from prior
version
(.net 1?). The main menu was visible both in designer and in run time. I
had ripped out the ole webbrowser component and replaced with an more
..net
interface webbrowser.
There was and there still is not separate designer file for myform.

If I create a new project, I will not see any guid component the main code
file but see the in the designer file. that is I end up with 2 partial
classes

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:UzWZg.7064$Z46.4151@trndny05...
it looks as if the menu is not included in the controlcolleciton.

Find a line the says something close to:

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl})

If your menu is not listed in the control collection, add it manually.

MyForm.Controls.AddRange(New Control() {AControl,AnotherControl,
MyMenuControl})
See if this helps....

--
Thiele Enterprises - The Power Is In Your Hands Now!
"gs" <gs@dontMail.teluswrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
oh, btw, I went to code and extract the code for mainenu
>
>
'Required by the Windows Form Designer
>
Private components As System.Component.IContainer
>
'NOTE: The following procedure is required by the Windows Form
Designer
>
'It can be modified using the Windows Form Designer.
>
'Do not modify it using the code editor.
>
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
>
...
>
>
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()
>
Me.components = New System.ComponentModel.Container
>
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))
>
Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)
>
Me.fileMI = New System.Windows.Forms.MenuItem
>
Me.openMI = New System.Windows.Forms.MenuItem
>
Me.printMI = New System.Windows.Forms.MenuItem
>
Me.MenuItem6 = New System.Windows.Forms.MenuItem
>
Me.exitMI = New System.Windows.Forms.MenuItem
>
Me.editMI = New System.Windows.Forms.MenuItem
>
Me.cutMI = New System.Windows.Forms.MenuItem
>
Me.copyMI = New System.Windows.Forms.MenuItem
>
Me.pasteMI = New System.Windows.Forms.MenuItem
>
Me.MenuItem12 = New System.Windows.Forms.MenuItem
>
Me.findMI = New System.Windows.Forms.MenuItem
>
Me.viewSourceMI = New System.Windows.Forms.MenuItem
>
Me.toolsMI = New System.Windows.Forms.MenuItem
>
Me.internetOptionsMI = New System.Windows.Forms.MenuItem
>
Me.helpMI = New System.Windows.Forms.MenuItem
>
Me.aboutMI = New System.Windows.Forms.MenuItem
>
Me.contextMenu = New System.Windows.Forms.ContextMenu
>
...
>
'MainMenu1
>
'
>
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI,
Me.helpMI})
>
'
>
'fileMI
>
'
>
Me.fileMI.Index = 0
>
Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.openMI, Me.printMI, Me.MenuItem6, Me.exitMI})
>
Me.fileMI.Text = "File"
>
'
>
'openMI
>
'
>
Me.openMI.Index = 0
>
Me.openMI.Text = "&Open..."
>
'
>
'printMI
>
'
>
Me.printMI.Index = 1
>
Me.printMI.Text = "&Print..."
>
......
>
"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
>>
>gs schrieb:
>>
>>thanks
>>both.
>>1
>>in design mode, the main menu does not show up. Unless I click on
any
>>control to select property,, and then scroll to Mainmenu1, I will
then
>>see
>>the main menu. if the current control is no men menu, I will not see
>>main
>>menu in designer.
>>>
>>2. when running, no main menu either
>>>
>>
>Is it possible that you accidentally "hide" your Mainmenu behind some
>other Controls or Containers (A Panel, GroupBox or whatever)?
>Stupid question, I know - But this was the only way for me to create
>this problem...
>>
>
>




Oct 20 '06 #14
GS
yes, same problem, not compatible with controls.

talking about menu strip. I am trying somehow specify meainmenu1 for use
with menustrip.

hopefully, I have better luck there. failing that figure out use of
icomponent.

failing that start from scratch- a long process

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:jxa_g.415$k63.407@trndny06...
Strange that that happens since the MainMenu is derived from a control....

Have you tried this code...

Me.Controls.AddRange(New Control() {Me.MainMenu1})

Actually am suprised that you don't have MainMenuStrip control.
--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:u$**************@TK2MSFTNGP06.phx.gbl...
thank you your patience
however

Controls.Add(MainMenu1)
yields compiler error of
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be
converted to 'System.Windows.Forms.Control'.

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:ybZZg.4621$kG5.2814@trndny07...
to use the addrange method, you have to declare an instance.

Controls.AddRange(New MainMenu() {MainMenu1})

you can also use:

Controls.Add(MainMenu1)

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Thank you.

unfortunately Me.Controls.AddRange(MainMenu1)
leads to error:
Error 1 Value of type 'System.Windows.Forms.MainMenu' cannot be
converted
to
'1-dimensional array of System.Windows.Forms.Control'. ...myform.vb 1284
30
myform

actually there is no prior me.control.addrange but quite a number of
me.controls.add(...)
none for me.mainmenu1
if I use add instead of addrange
Me.Controls.Add(MainMenu1)
I get similar message like using addrange.

btw, I am using visual basic .net 2005 express with latest update. the
project initially upgraded an webICHpstCtrl demo project from prior
version
(.net 1?). The main menu was visible both in designer and in run time.
I
had ripped out the ole webbrowser component and replaced with an more
.net
interface webbrowser.
There was and there still is not separate designer file for myform.

If I create a new project, I will not see any guid component the main
code
file but see the in the designer file. that is I end up with 2 partial
classes

"Ryan S. Thiele" <ma*****@verizon.netwrote in message
news:UzWZg.7064$Z46.4151@trndny05...
it looks as if the menu is not included in the controlcolleciton.
>
Find a line the says something close to:
>
MyForm.Controls.AddRange(New Control() {AControl,AnotherControl})
>
If your menu is not listed in the control collection, add it manually.
>
MyForm.Controls.AddRange(New Control() {AControl,AnotherControl,
MyMenuControl})
>
>
See if this helps....
>
--
Thiele Enterprises - The Power Is In Your Hands Now!
"gs" <gs@dontMail.teluswrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
oh, btw, I went to code and extract the code for mainenu


'Required by the Windows Form Designer

Private components As System.Component.IContainer

'NOTE: The following procedure is required by the Windows Form
Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

...


<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()

Me.components = New System.ComponentModel.Container

Dim resources As System.ComponentModel.ComponentResourceManager =
New
System.ComponentModel.ComponentResourceManager(Get Type(FormMyApp))

Me.MainMenu1 = New System.Windows.Forms.MainMenu(Me.components)

Me.fileMI = New System.Windows.Forms.MenuItem

Me.openMI = New System.Windows.Forms.MenuItem

Me.printMI = New System.Windows.Forms.MenuItem

Me.MenuItem6 = New System.Windows.Forms.MenuItem

Me.exitMI = New System.Windows.Forms.MenuItem

Me.editMI = New System.Windows.Forms.MenuItem

Me.cutMI = New System.Windows.Forms.MenuItem

Me.copyMI = New System.Windows.Forms.MenuItem

Me.pasteMI = New System.Windows.Forms.MenuItem

Me.MenuItem12 = New System.Windows.Forms.MenuItem

Me.findMI = New System.Windows.Forms.MenuItem

Me.viewSourceMI = New System.Windows.Forms.MenuItem

Me.toolsMI = New System.Windows.Forms.MenuItem

Me.internetOptionsMI = New System.Windows.Forms.MenuItem

Me.helpMI = New System.Windows.Forms.MenuItem

Me.aboutMI = New System.Windows.Forms.MenuItem

Me.contextMenu = New System.Windows.Forms.ContextMenu

...

'MainMenu1

'

Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.fileMI, Me.editMI, Me.toolsMI, Me.analyseMI, Me.searchMI,
Me.helpMI})

'

'fileMI

'

Me.fileMI.Index = 0

Me.fileMI.MenuItems.AddRange(New System.Windows.Forms.MenuItem()
{Me.openMI, Me.printMI, Me.MenuItem6, Me.exitMI})

Me.fileMI.Text = "File"

'

'openMI

'

Me.openMI.Index = 0

Me.openMI.Text = "&Open..."

'

'printMI

'

Me.printMI.Index = 1

Me.printMI.Text = "&Print..."

......

"Norman Chong" <no*********@freenet.dewrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...

>
gs schrieb:
>
>thanks
>both.
>1
>in design mode, the main menu does not show up. Unless I click on
any
>control to select property,, and then scroll to Mainmenu1, I will
then
>see
>the main menu. if the current control is no men menu, I will not
see
>main
>menu in designer.
>>
>2. when running, no main menu either
>>
>
Is it possible that you accidentally "hide" your Mainmenu behind
some
other Controls or Containers (A Panel, GroupBox or whatever)?
Stupid question, I know - But this was the only way for me to
create
this problem...
>


>
>



Oct 21 '06 #15
gs
thank you for continue working with me on this one.

making mainmenu1 to appear in run time turns out to be as simple as adding
menu = mainmenu1
in form load event.

now only if I can make mainmenu1 appear in designer then the problem would
be completely solved

"GS" <gs**********************@msnews.Nomail.comwrote in message
news:ez**************@TK2MSFTNGP03.phx.gbl...
the main menu in the application seemed to disappeared all together until
I
click on an control and select mainmenu1 in designer. then the mainmenu1
displays where it should be but running it or deselecting the mainmenu1,
the
menu disappears again.
what can I do. to fix the problem


Oct 21 '06 #16
hello gs ,

Place a new main menu at the top and set the action handlers of the onew
method handled by the old menu functions. this will solve your Problem.

gs wrote:
>thank you for continue working with me on this one.

making mainmenu1 to appear in run time turns out to be as simple as adding
menu = mainmenu1
in form load event.

now only if I can make mainmenu1 appear in designer then the problem would
be completely solved
>the main menu in the application seemed to disappeared all together until
I
[quoted text clipped - 4 lines]
>>
what can I do. to fix the problem
--
Atheeque

Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200610/1

Oct 21 '06 #17
GS
thank you. in visual basic studio express 2005, where can find in designer
the tool for mainmenu?
Or were you taking about a new menustrip under All windows Forms of the
toolbox?

I found another to access the mainmenu1 from designer. Open Document
Outline for the form, expand and locate MainMenu1
From there, I can add /change items in the designer. So this will do for
now
"Atheeque via DotNetMonster.com" <u28130@uwewrote in message
news:68192395979ec@uwe...
hello gs ,

Place a new main menu at the top and set the action handlers of the onew
method handled by the old menu functions. this will solve your Problem.

gs wrote:
thank you for continue working with me on this one.

making mainmenu1 to appear in run time turns out to be as simple as
adding
menu = mainmenu1
in form load event.

now only if I can make mainmenu1 appear in designer then the problem
would
be completely solved
the main menu in the application seemed to disappeared all together
until
I
[quoted text clipped - 4 lines]
>
what can I do. to fix the problem

--
Atheeque

Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200610/1

Oct 24 '06 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bubbagump | last post by:
Hey hey.... Need some help with CSS menus. I need to figure out how to keep my main menu items highlighted when I am hovering on sub-items or sub-sub-items. Here is my code: #menu { width:...
1
by: Richard Hollenbeck | last post by:
I'm building custom menubars for my application--a different one for each form. When I right-click on a menubar and select Customize and click on the toolbars tab, the menubar called "Menu Bar"...
7
by: Danielb | last post by:
I want my application to run most of the time as just an notify icon visible in the system tray, with some dialogs windows that open if the user selects an option from the context menu on the tray...
2
by: cj | last post by:
How can I make the mainmenu look more like a bar? I think it needs the line below it or border or something. It just looks like a row of words at the top of the form--indistinguishable from other...
0
by: tomv | last post by:
hi my name is tom i wrote a project in c# .net 2003 and it's work fine until i added a main menu to my main form now every time i run my project i get this error: " An unhandled exception of...
2
by: Tom Costanza | last post by:
For the life of me, I can't seem to merge main menu items from child to parent with MDI forms. I can merge sub-menus, but not main menu items. So I have a parent form with: File Windows Help...
7
by: joecap5 | last post by:
I have a main window from which I want to open a separate side menu window. I then want to create a list of items on that side menu by clicking on the item names in the main window. So far I am...
6
by: happyse27 | last post by:
Hi All, How do I change the height of the main menu as the height is inconsistent due to some of main menu's item stretches to 2 rows while, the other main menu's items are stretched to 1 row. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.