|
-
May 2nd, 2002, 07:10 AM
#1
Right-Click pop-up HELP!!!
o.k. i am writing a program and i want to have a menu pop-up by the mouse when i right click. how exactly do i do that.I have no idea where to start,could someone help me out. Thanks!!
-
May 2nd, 2002, 08:33 AM
#2
right click popup code. Just put this in the contructor for your form. Inhertiance takes care of the the detecting right click so you dont need to code that part.
Code:
Dim mnuContext As ContextMenu
Me.mnuContext = New ContextMenu()
mnuContext.MenuItems.Add(New MenuItem("Unzip", New EventHandler(Me.mnuUnzip_Clicked)));
controltorightclickon.ContextMenu = mnuContext
-
May 2nd, 2002, 10:04 AM
#3
put it were?
o.k i see the code but everywere i put it it either showe errors or it does not work. Now i know you know what you are doing so it has to be me doing something wrong.could you tell me were exactly to put it?
-
May 2nd, 2002, 10:43 AM
#4
it needs to be put in the contructor of the form..in other words the Sub New()
-
May 2nd, 2002, 12:56 PM
#5
what i need to happen
i want to run be running a thread behind the form that will detect a right click of the mouse at any point on the form and put the same contextmenu up for everything right clicked. i do not know how to detect a right mouse click for everything on a thread that is running seperately from the form. what can i do??????
-
May 2nd, 2002, 12:59 PM
#6
controltorightclickon.ContextMenu = mnuContext
just do that for every control that will use the same menu.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|