Discussion:
Dynamic Popup Menu
(too old to reply)
G***@gmail.com
2007-08-18 07:48:07 UTC
Permalink
I developing an dynamic project where outlook bar like display is
used.

my requirement is that on click of the button, i need to show the menu
as a popup menu, but which menu to show is controled by a external
factor.

Menu name which needs to be shown is stored in a string variable

i am using the following command

popupmenu <variable name>

it does'nt seems to work, kindly help me
MikeD
2007-08-18 10:51:56 UTC
Permalink
Post by G***@gmail.com
I developing an dynamic project where outlook bar like display is
used.
my requirement is that on click of the button, i need to show the menu
as a popup menu, but which menu to show is controled by a external
factor.
Menu name which needs to be shown is stored in a string variable
i am using the following command
popupmenu <variable name>
it does'nt seems to work, kindly help me
You should explain what you mean by "it does'nt seems to work" because that
doesn't really tell us anything. It's usually best to include your exact
source code (copied and pasted from the IDE) too.

However, I can make a guess that you get a compile time, type mismatch
error. The argument you pass to PopupMenu has to be a menu *object*, not a
string. Use the Controls collection to get a reference to the desired Menu
control. Along the lines of this:

Dim sMenu As String
sMenu = "mnuEdit"
PopupMenu Controls(sMenu)
--
Mike
Microsoft MVP Visual Basic
Loading...