Displaying popup menus on a child form from and MDIForm
Posted on 2003-03-31
I'm having problems displaying a menu located on an MDIform, as a popup menu on a child from. I am using Visual Basic v6.
I have created a menu system on the MDIForm ('frmMain') with a drop down menu called 'popAdd' which is hidden. I am attempting to display the menu on a child form called 'frmOrder'. When I click a button called 'cmdAdd', on 'frmOrder', I wish to display 'popAdd' as a popup menu next to the button.
I don't want to create a menu system on the child form because this will replace the menus on the MDIForm which I need to remain fixed.
Here is the code from the button on 'frmOrder' (child) that attempts to display the popup menu on 'frmMain' (MDI)...
Private Sub cmdAdd_Click()
PopupMenu frmMain.popAdd, , cmdAdd.Left + cmdAdd.Width, cmdAdd.Top
I have searched experts-exchange.com and the solutions I can find suggest that my code should work correctly, however, I am recieving a runtime error '426' - 'Only one MDI form allowed'.
Has anybody got any ideas what is causing the problem and how to get around it?
Thanks for any help,