Plain and simple. Popupmenu does not work. I'm writing an usercontrol and none of the Popupmenu works. Does anyone have any clue about it?
Printable View
Plain and simple. Popupmenu does not work. I'm writing an usercontrol and none of the Popupmenu works. Does anyone have any clue about it?
from user control you'd have to specify Parent.MenuName:
VB Code:
'label is located directly on the user control Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = vbRightButton Then PopupMenu Parent.mnuFile End If End Sub
But the menu belongs to the usercontrol itself.Quote:
Originally Posted by RhinoBull
I have no problem using the following code inside a usercontrolVB Code:
Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If (Button And vbRightButton) = vbRightButton Then UserControl.PopupMenu mnuPop End If End Sub
Me neither... but on some conditions, the popupmenu won't work. What's more, I have an usercontrol (EFMMask) with a popupmenu that works ok. When I include this usercontrol (EFMMask) into another... no popupmenu works. Not even the EFMMask's menu.Quote:
Originally Posted by Joacim Andersson
I can't reproduce your problem. I've created one usercontrol with a menu, and put that in another usercontrol that also has a menu. When I slap the other control on a form and run the project I get both popup menus depending on where I click.
can u post your code..
I'm trying to reproduce it in an easier project (without all the resize and event's code9... but I cannot reproduce it. :confused:
My guess is that the system does not have enough memory to popup the menu... because it's working on a simpler project.
I doubt that, because if that would be the case you wouldn't be able to display popup menus in any application. There must be something else in your code that suppress the menus.Quote:
Originally Posted by Mc Brain
I'm running out of ideas. Do you have anything?Quote:
Originally Posted by Joacim Andersson
Not without seeing your code. Can you upload your project?Quote:
Originally Posted by Mc Brain
I can't!! Even the project I did to code and test the usercontrol seems to be working correctly.
However, when I use this Usercontrol in a form which is loaded through a "bigger" Usercontrol, does not work! :cry: