iyufa
asked on
VS 2005 Build a Menu from VB code
I need an example for VB.net in VS2005. On how to create a menu on a fly.
Menu Structure
OP1 GMM
OP2 Inq
main
DMM
Inq
main
I was requested to do it on the fly not at the design mode.
Thank you. I am a beginner
Menu Structure
OP1 GMM
OP2 Inq
main
DMM
Inq
main
I was requested to do it on the fly not at the design mode.
Thank you. I am a beginner
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Where can i get a menustrip?
I could only see the menu control in my VS2005 tools
I could only see the menu control in my VS2005 tools
ASKER
Once again I am jsut a begginer: I am not sure ai undesetnt the menustrip
Will something like this work:
Dim itmHome As New MenuItem
Dim itmMerchandise As New MenuItem
Dim itmMerchantMgmt As New MenuItem
itmHome.Text = "Home"
itmMerchandise.Text = "Merchandise"
itmMerchantMgmt.Text = "Merchant Mgmt"
CSMenu.Items.Add(itmHome)
CSMenu.Items.Add(itmMercha ndise)
Will something like this work:
Dim itmHome As New MenuItem
Dim itmMerchandise As New MenuItem
Dim itmMerchantMgmt As New MenuItem
itmHome.Text = "Home"
itmMerchandise.Text = "Merchandise"
itmMerchantMgmt.Text = "Merchant Mgmt"
CSMenu.Items.Add(itmHome)
CSMenu.Items.Add(itmMercha
ASKER
This is worked. How can i add the children under each of the main header?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
Dim mnu As New MenuStrip
Dim tsmnu As New ToolStripMenuItem("MainMen
tsmnu.DropDownItems.Add("L
tsmnu.DropDownItems.Add("L
mnu.Items.Add(tsmnu)
Me.MainMenuStrip = mnu
Me.Controls.Add(mnu)
Sub action(ByVal sender As Object, ByVal e As System.EventArgs)
Dim tsmnu As ToolStripMenuItem = CType(sender, ToolStripMenuItem)
MsgBox(tsmnu.Text)
End Sub