There are two forms. The first one, let's call it form1 is a simple form. The second one, form2, is a hidden one with a menu on it.
When you right-click on the form1, it calls a popupmenu from form2
In the popupmenu that is located in form2, there is a menu "Unload this form".
There also is a module with code:
The code for showing up the popupmenu when you right click in the form1 is like this:
The code in the "Unload" menu on the form2 is like this:
This doesn't work. How can I solve it? Thanks in advance.
When you right-click on the form1, it calls a popupmenu from form2
In the popupmenu that is located in form2, there is a menu "Unload this form".
There also is a module with code:
Code:
Public formFrom as string
Code:
Private Sub Form1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then
Me.PopupMenu form2.menu
formFrom = me.name
Else
End If
End Sub
Code:
Private Sub unload_Click()
Unload formFrom
End Sub