[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Menu at run-time

Posted on 1999-01-12
5
Medium Priority
?
154 Views
Last Modified: 2010-05-03
Hi,

I use VB6.
How can i add new topics to menu at runtime?
How free am i modifing menu at runtime?

-Peter
0
Comment
Question by:hpet
5 Comments
 
LVL 3

Accepted Solution

by:
jjbyers earned 200 total points
ID: 1455719
Your very free at run-time to add menu items.

Look at the SDINote.vbp sample app that comes with VB5.

Hope this helps.
0
 

Expert Comment

by:mawe
ID: 1455720
Create a control array e.g. mnuFileItem(0), mnuFileItem(1) and so on at design time. Then set the visible property to False for the blank menu controls, and set the visible property to True once you've added text in a control.

0
 
LVL 3

Expert Comment

by:jjmartin
ID: 1455721
Here is an example of some menu items being added at run time.  This is based off of a table with some names that are inserted into the menu.  Hope this helps.

rstNames is the recordset that contains the names.
mnuFileOpenName(Name_Idx) is the menu item array.  During design time, set the index property to zero.

Do Until rstNames.EOF

      If Name_Idx > 0 Then
          Load Me.mnuFileOpenName(Name_Idx)
'Here we are loading the next instance of the menu item, we only load if it is greater than zero because the menu item with index zero was created at design time.
      End If

        Me.mnuFileOpenName(Name_Idx).Caption = rstNames!Name 'set the caption for the new menu item
      Me.mnuFileOpenName(Name_Idx).visible = true 'showing the new menu item
        Name_Idx = Name_Idx + 1 'increment the load index
        rstNames.MoveNext 'move to the next record

    Loop
0
 
LVL 14

Expert Comment

by:waty
ID: 1455722
0
 
LVL 1

Author Comment

by:hpet
ID: 1455723
Sorry for delay...

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question