Important alert: (current site time 7/16/2013 2:07:59 AM EDT)
 

VB icon

__ Very Easy Popup menu

Email
Submitted on: 6/16/2002 6:13:18 AM
By: Tha0s 
Level: Beginner
User Rating: By 12 Users
Compatibility: VB 6.0
Views: 38515
author picture
(About the author)
 
     Simple popup menu
 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :__ Very Easy Popup menu
'**************************************
'Easy for babys :-)
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: __ Very Easy Popup menu
' Description:Simple popup menu
' By: Tha0s
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=35908&lngWId=1'for details.'**************************************

Private Sub Command1_Click()
Me.PopupMenu menu
End Sub


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
6/16/2002 6:19:09 AMMrBobo

Hmmm
(If this comment was disrespectful, please report it.)

 
6/16/2002 7:07:51 AMM@verick

Indeed
(If this comment was disrespectful, please report it.)

 
6/16/2002 5:17:19 PMC. Sibon

hahhaha tja.... da's waar ja.... lol
(If this comment was disrespectful, please report it.)

 
6/17/2002 3:03:57 AMjd

uhh
(If this comment was disrespectful, please report it.)

 
6/25/2002 6:42:24 AMdodi

ilginc
(If this comment was disrespectful, please report it.)

 
6/30/2002 7:47:08 PMAgret

this doesn't work x.x
figures.
(If this comment was disrespectful, please report it.)

 
10/9/2002 1:41:26 AM

coooooooooooool
(If this comment was disrespectful, please report it.)

 
10/9/2002 9:39:00 AMStefan Carter

hahaha
(If this comment was disrespectful, please report it.)

 
10/12/2002 1:49:33 PM

eh?
(If this comment was disrespectful, please report it.)

 
10/25/2002 11:32:40 AMMarvin Hufford

Yes--but--the screen shot that you have looks like a message box. To use Me.PopupMenu mnuFile, a menu object must be created (preferrable with the menu editor) with a menu (like &File) and with at least one submenu (like &New, &Open, etc.). When called by the program, the menu pops up at the cursor.
(If this comment was disrespectful, please report it.)

 
11/27/2002 2:24:15 PM

At least:

Private Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu menu
End If
End Sub
(If this comment was disrespectful, please report it.)

 
1/16/2003 7:32:31 PMunevenratio

ok, theres my bus. I'll be gone now, bye!
(If this comment was disrespectful, please report it.)

 
3/7/2003 2:42:36 AM[Wouter van Koppen]

k zie het nut niet van uploaden dit soort ROMMEL iedere mongool kan dit toch wel verzinnen
(If this comment was disrespectful, please report it.)

 
3/19/2003 9:31:45 PMgym

Give me a brake !! doude NM ...
(If this comment was disrespectful, please report it.)

 
5/5/2003 9:34:16 AM

:p
(If this comment was disrespectful, please report it.)

 
5/28/2003 1:14:44 PM

Do you think were dumb?

(If this comment was disrespectful, please report it.)

 
7/8/2003 7:31:25 AMHolland

En dit is de Code of the Day?
(If this comment was disrespectful, please report it.)

 
7/8/2003 1:24:46 PMBoogyMan

I stayed at a Holiday Inn Express lastnight.
(If this comment was disrespectful, please report it.)

 
7/8/2003 3:10:32 PMTimothy OConnor

It didn't work!!!!!
(If this comment was disrespectful, please report it.)

 
7/8/2003 9:09:47 PM

I'll stick to the message box
(If this comment was disrespectful, please report it.)

 
7/9/2003 1:06:01 AM

Got any more good 'uns like that?
(If this comment was disrespectful, please report it.)

 
9/13/2003 5:13:18 AM

TAXI!!
(If this comment was disrespectful, please report it.)

 
11/9/2003 3:45:11 AMCraigénbök

The Main thing you are missing is the Project References required to make the code work.
To set this up, goto the "Project" Menu, click on references, and select the "Microsoft DAO 3.51 Object Library"
All Done...
(If this comment was disrespectful, please report it.)

 
12/2/2003 1:07:01 AM

Give the guy a break... lol
(If this comment was disrespectful, please report it.)

 
12/18/2003 3:53:46 AM

It doesn't work...................
(If this comment was disrespectful, please report it.)

 
12/25/2003 9:47:23 AM

Pffffffff, 1 + 1 = 2 or 11 whatever
(If this comment was disrespectful, please report it.)

 
3/7/2004 12:19:54 PMBryant Zadegan

geez cut him some slack! some ppl dont know this stuff!
(If this comment was disrespectful, please report it.)

 
3/9/2004 9:47:09 AM

LOL. That isnt a screenshot. thats his profile picture. To get this working make a seperate form. Make a menu with the menu editor icon. And then link to that new forms menu with:
me.popupmenu form2.MyMenu
(If this comment was disrespectful, please report it.)

 
4/21/2004 8:21:26 AMBen Jones

rubish, at least do it correct
(If this comment was disrespectful, please report it.)

 
10/13/2004 3:49:19 PMLeon J Aiossa

LOL!
Such a simple idea could be a whole lot more...

This code asumes you have a menu called mnuMyMenu and command button Command1

Option Explicit
Public Enum eMouseButton
lLeftMouseButton = 0
lRightMouseButton = 1
lScrollWheel = 2
End Enum
Private Sub Command1_Click()
ActivatePopup mnuMyPopup
End Sub
Public Sub ActivatePopup(lButton As eButtonTypes, lMenu As Menu)
If Len(lMenu.Caption) <> 0 Then
Select Case lButton
Case 0
Case 1
PopupMenu lMenu
End Select
End If
End Sub
(If this comment was disrespectful, please report it.)

 
10/20/2004 11:45:38 AMÇ®ÎMÏÑÀL

Ahh ... That Really Opens Menus Quickly.

hahaha .. nice joke

One more thing ...

Create a String Value named MenuShowDelay = 0 in ..

HKEY_CURRENT_USER\ControlPanel\Desktop\

that will speed up windows menu..
mehdipanjwani@msn.com

(If this comment was disrespectful, please report it.)

 
11/17/2004 11:03:43 AM

Are you lost your brain on empty space Tha0s ? Go find it LoL!
(If this comment was disrespectful, please report it.)

 
2/24/2005 2:43:35 AM

hahhahahaha.....verry funny
(If this comment was disrespectful, please report it.)

 
6/19/2005 8:54:32 PM

É REALMENTE FENOMENAL! FICAMOS IMPRESSIONADOS NO BRASIL. PARABÉNS! VOCÊ É MUITO INTELIGENTE.
(If this comment was disrespectful, please report it.)

 
8/21/2005 12:46:54 PMQwizkid

't is wel de code, maar je mot wel wat meer uitleggen.....
(If this comment was disrespectful, please report it.)

 
10/19/2005 2:19:58 PMsprgm

euh

(If this comment was disrespectful, please report it.)

 
2/10/2006 10:09:45 AMAtribune

Start a new project click on Tools > menu editor. Add a menu with at least one sub menu. Uncheck visible. Add a command button, named command1.

Add this code to your form

Private Sub Command1_Click()
Me.PopupMenu mnuMenu
End Sub

Private Sub mnuSubMenu_Click()
MsgBox "Popup"
End Sub


Works perfect
(If this comment was disrespectful, please report it.)

 
11/15/2006 2:05:49 AM

\?
(If this comment was disrespectful, please report it.)

 
1/7/2007 6:43:54 AMKaveMan

How to Add a Right Click/Pop-up Mouse Menu.

Step 1: Start a New Standard .EXE Project

Step 2: Click on Tools > Menu editor (Opens Menu Editor Dialog)

Step 3: Put 'Menu1' in the Caption then put 'MenuOne' for the Name. Click the 'Next' Button

Step 4: Put 'Test1' in the Caption then put 'TestOne' for the Name. Now click on the arrow that is pointing right► (You should see four dots next to Test1). Then click the 'OK' button.

Step 5: Goto the Visual Basic Menu and click on View > Code and add this:

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
Form1.PopupMenu MenuOne
End If
End Sub

Step 6: Click on Run > Start (or press the 'F5' button on the keyboard).

Note:
Button 1 = Left Mouse Button
Button 2 = Right Mouse Button
Button 3 = Explore Left Mouse Button
Button 4 = Middle Mouse Button
Button 5 = Explore Right Mouse Button
(If this comment was disrespectful, please report it.)

 
8/13/2008 6:45:09 PM

Well, i can say it better than never, ups.............:)
(If this comment was disrespectful, please report it.)

 
6/6/2010 6:20:35 AMVass Peter

right click Pop-up menu :
Private Sub Form_MouseDown(ButtonAsIntegeShift As Integer, X As Single, Y As Single)
If Button = 2 Then
Me.PopupMenu menu
End If
End Sub

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.