Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-02-2009
Member
 
Join Date: Jan 2009
Posts: 18
How do I make a menu popup from a CommandButton?

Hi,

How do I make a menu popup from a CommandButton?

I want the code to popup a menu on a CommandButton & it has OK button on it.

Regards!
Reply With Quote
  #2  
Old 27-02-2009
Member
 
Join Date: Jun 2008
Posts: 97
Re: How do I make a menu popup from a CommandButton?

Pop-ups

According to the Microsoft?s terminology, the term ?pop-up? can be used for several controls: pop-up menu, pop-up button, and submenu. With Add-in Express you can create your own pop-up as an element of your controls commandbar collection and add to it any control via the Controls property. But pop-ups have a feature that is very annoying: if an edit box or a combo box is added to a pop-up, their events are fired very oddly. Don?t regard this bug as that of Add-in Express. It seems to be intended by Microsoft.
Reply With Quote
  #3  
Old 27-02-2009
Member
 
Join Date: May 2008
Posts: 115
Re: How do I make a menu popup from a CommandButton?

Code:
MsgBox "Your Message", vbExclamation + vbOKOnly, "Box Title"
You can remove the "vbExclamation +", or replace it with vbCritical, vbQuestion... Just select one from the list you get when writing down ur code.
Reply With Quote
  #4  
Old 27-02-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: How do I make a menu popup from a CommandButton?

Making & using a PopUp Menu

Making a popup menu (vb4)

step 1: starting
step 2: make the menu-options
step 3: make the code
step 4: let the popup appears
step 5: running....


step 1: starting

make a new project; a new form; some labels with caption; some textboxes
and some commandbuttons


step 2: make the menu-options

- view the form
- choose Tools/Menu Editor
- make a option:
caption = Testing
name = dummy
visible = FALSE
- make some sub-options:
caption = &Clear
name = testing
index = 1
caption = &Print
name = testing
index = 2
- click on OKE


step 3: make the code

- view code of the form
- choose for Object = testing
- place the next code:

Select case Index
Case 1 'clear
Call ClearAll
Case 2 'print
PrintForm
End Select

in the general section place the next proc:

Private sub ClearAll()
Dim Control

For Each Control In Form1.Controls
If TypeOf Control Is TextBox Then Control.Text = ""
If TypeOf Control Is Label Then Control.Caption = ""
If TypeOf Control Is CommandButton Then Control.Caption = ""
Next Control

End Sub



step 4: let the popup appears

- place in the MouseDown event of every control you want to accept
a request for the popup to show the next code

Private sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If button = 2 Then Me.PopupMenu dummy
End Sub

step 5: press F5 and click the right button on different locations on the form.


Of course it's just an example. You can let different popupmenus appear with different
controls. All with different options. It's just for the idea..
Reply With Quote
  #5  
Old 27-02-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: How do I make a menu popup from a CommandButton?

If you have added a menu using the form's menu editor, then you can make a popup menu by using:
Form1.PopUpMenu menuheadername
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How do I make a menu popup from a CommandButton?"
Thread Thread Starter Forum Replies Last Post
popup menu in Firefox hosed when used on Mac Jagathi Technology & Internet 7 29-06-2011 09:12 PM
How to make menu button red in opera 11.50 Condolem Technology & Internet 4 20-06-2011 04:27 AM
Creating a Popup Menu in java Adrina_g Software Development 4 25-02-2010 10:29 PM
Download Hawkscope: Allows Fast Access to Files and Folders with Popup Menu Dr.Jones Tips & Tweaks 1 14-04-2009 01:45 PM


All times are GMT +5.5. The time now is 07:44 AM.