Discussion Thread
UniToolbox
Message Thread
The leading control suite for Unicode development in Visual Basic.
Posted in the UniToolbox Forum.
Popup menu sample code?
Hi,
Currently evaluating the product...do you have any sample code for how to create popup menus? Something more substantial than what is in the FAQ?
Thanks
Popup menu sample code?
Popup menu sample code?
OK, one question....
I downloaded the sample menu application and it works just as expected.
However, when I try to write similar code in my application I get a compile error on the
Set o = .add("PopUp")
line in the InitializeMenus routine. Says that "add" isn't a method of the object.
What am I missing? I added the module-wide variables at the top and the UniMenu1 control to my form.
There must be something else...
Thanks
Popup menu sample code?
hard for me to say without seeing your project! I'd try starting at the demo project and modifying it.
Popup menu sample code?
Got it...
Had to declare my variables as:
Private mobjMenuSetA As UniToolbox2.Menus
instead of
Private mobjMenuSetA As Menus
Thanks!
Popup menu sample code?
One more question...
Is there a known issue with showing a MsgBox in the click event of a popup menu?
For example - in the sample app above I changed the
Debug.Print "UniMenu1_MenuClick() --", Menu.Caption
to
MsgBox "UniMenu1_MenuClick() --" & Menu.Caption
The popup menu then gets "stuck" in the top part of the form where the "traditional" menu bar goes.
Is there a workaround for this?
Thanks
Popup menu sample code?
Yes this is a bug and the workaround is to use a Timer with a tiny delay, this will sort out the rendering problem.
Popup menu sample code?
OK. Before or after the MsgBox. Got a sample?
Thanks for all your help with this, BTW.
Popup menu sample code?
On the menu click start a timer. When the timer completes open the MsgBox.
Popup menu sample code?
Still not getting it. Not sure how the Timer control can "delay" it like that.
I used..
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
..but still no dice.
Popup menu sample code?
No don't use Sleep use a Timer.
On the menu click enable the Timer, and then when it fires show the MsgBox.
Popup menu sample code?
Got it. Had my Timer interval set to 0...
Need more coffee...
Thanks again!