Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Creating Dynamic menu from database in vb.Net

Creating Dynamic menu from database in vb.Net

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasehelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    poonams
    wrote on last edited by
    #1

    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

    M A 2 Replies Last reply
    0
    • P poonams

      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

      M Offline
      M Offline
      MohammadAmiry
      wrote on last edited by
      #2

      Could you send the code? So that we can tell you where the problem comes from!

      P 1 Reply Last reply
      0
      • P poonams

        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

        A Offline
        A Offline
        AliAmjad
        wrote on last edited by
        #3

        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)

        P 1 Reply Last reply
        0
        • A AliAmjad

          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)

          P Offline
          P Offline
          poonams
          wrote on last edited by
          #4

          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

          P 1 Reply Last reply
          0
          • M MohammadAmiry

            Could you send the code? So that we can tell you where the problem comes from!

            P Offline
            P Offline
            poonams
            wrote on last edited by
            #5

            '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

            1 Reply Last reply
            0
            • P poonams

              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

              P Offline
              P Offline
              poonams
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups