Home > How-To Library > Forms

How to Create/Assign PopupMenu to a control.

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
'Suppose u want a menu to be appeared when a textbox is clicked with the 'Right-Mouse Button. Create a menu from menu editor (popup1 name is used in this 'example), set its visible property to false. And place the following code in 'the textbox's mousedown event. Private Sub Text1_click() If Button = 2 Then Form1.PopupMenu popup1 End If End Sub

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.