Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically populating a menu 1

Status
Not open for further replies.

webmigit

Programmer
Aug 3, 2001
2,027
US
I'm trying to migrate my application from vb 6 to .NET and so far, it hasn't been good... the built in tool doesn't work well... It doesn't migrate the big changes.

How do I hand dynamically creating a menu (I used a control array previously, but control arrays are no longer a feature).

Why did they get rid of control arrays?[/b From what I've seen so far, and I'll admit that I'm new... the replacement practices are more difficult, if anything.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I would advise NOT migrating application from VB6 to .Net. VB.Net is NOT VB7. It is a completely new programming structure that has a VB like syntax. If your VB6 app works fine, leave it in VB6. If you have massive changes to make to it, develop a proposal for the entire system, define business rules and processes, and create all of the system design documentation (which is much easier when you have a working solution), then start over in .Net.

As for dynamically creating menus, add a main menu object to the form in the GUI designer. Then in your code create new MenuItem objects. Add the MenuItem to the MenuItems collection on the MainMenu. The best way to see this is to create a new form, add a main menu and some items in the GUI. Then goto the code view and expand the region called " Windows Form Designer generated code ". Scroll down to the InitializeComponent method and track down the menu items you created.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top