Creating Dynamic menu from database in vb.Net
-
I have some problem .I want to create the menu at run time.User will enter some value into database by another form.the value should appear as new menu.My backend is MS access & front end is VB.net2003 after that,if user click on the menu it should disply the corrosponding report. plz reply
poonam
-
I have some problem .I want to create the menu at run time.User will enter some value into database by another form.the value should appear as new menu.My backend is MS access & front end is VB.net2003 after that,if user click on the menu it should disply the corrosponding report. plz reply
poonam
Could you send the code? So that we can tell you where the problem comes from!
-
I have some problem .I want to create the menu at run time.User will enter some value into database by another form.the value should appear as new menu.My backend is MS access & front end is VB.net2003 after that,if user click on the menu it should disply the corrosponding report. plz reply
poonam
Create a MenuItem object set its properties according to your requirements then add it to your main menu then declare its Click event handler and use AddHandler to connect it with the click event of the created menu item object. Hope it helps !
AliAmjad(MCP)
-
Create a MenuItem object set its properties according to your requirements then add it to your main menu then declare its Click event handler and use AddHandler to connect it with the click event of the created menu item object. Hope it helps !
AliAmjad(MCP)
-
Could you send the code? So that we can tell you where the problem comes from!
'Counting Values of Database s = "Select srno from cash" com = New OleDbCommand(s, con) con.Open() dr = com.ExecuteReader While dr.Read n = dr(0) End While con.Close() 'Selecting Account Type s = "Select account from cash" com = New OleDbCommand(s, con) con.Open() dr = com.ExecuteReader While dr.Read() a = dr(0) End While con.Close() For i = 1 To n Dim mShowMenuItem As MenuItem mShowMenuItem = DirectCast(sender, MenuItem) mShowMenuItem.MenuItems.Clear() Dim mSubSubMenuItem3 As New MenuItem mSubSubMenuItem3 = New MenuItem mSubSubMenuItem3.Index = i mSubSubMenuItem3.Text = a mSubSubMenuItem3.Enabled = True mSubSubMenuItem3.Visible = True AddHandler mSubSubMenuItem3.Click, AddressOf MenuClickHandler mShowMenuItem.MenuItems.Add(mSubSubMenuItem3) Next
poonam
-
thanx for ur reply.But I don't know how to start.Can u explain it by coding.plz it very urgent.plz help me
poonam
the below code generating a single menu.it was not working properly.I don't know hw to proceed??? [code] For i = 1 To n s = "Select account from cash" com = New OleDbCommand(s, con) con.Open() dr = com.ExecuteReader While dr.Read() a = dr(0) b = a 'End While 'con.Close() 'For i = 1 To n Dim mShowMenuItem As MenuItem mShowMenuItem = DirectCast(sender, MenuItem) mShowMenuItem.MenuItems.Clear() Dim mSubSubMenuItem As MenuItem ' This second sub menu item causes a problem: mSubSubMenuItem = New MenuItem mSubSubMenuItem.Index = i mSubSubMenuItem.Text = b mSubSubMenuItem.Enabled = True mSubSubMenuItem.Visible = True AddHandler mSubSubMenuItem.Click, AddressOf MenuClickHandler mShowMenuItem.MenuItems.Add(mSubSubMenuItem) i = i + 1 End While con.Close() Next
poonam