Solved

pop-up

Posted on 2000-02-18
8
463 Views
Last Modified: 2013-11-28
Is there a way to have a pop-up menu when you press the right mouse down. I know how it is working with the menu editor in vb. But I want this pop-up menu everywhere in the programm. Of course I can put it in every form but when they press on a tabblad which is on that form nothing happens. In this pop-up menu I want e.g. an euro calculator, a normal calculator and a calender. Any idee
0
Comment
Question by:rossel
  • 4
  • 3
8 Comments
 
LVL 6

Expert Comment

by:Marine
ID: 2536835
YOu are not required to have this code in every form. You can have it one form and let it be called from that form. The other method of doing is to design the menu in the run-time. You can use Control Collection to create a menu one limitation i would think of doing is that it may not allow you to create submenu items i think they only can be created during a runtime. However you can use an API functions to create this. Its some subclassing not really an easy part to do. Your easiest way of doing is to do it on a separte form
0
 
LVL 1

Expert Comment

by:okcman
ID: 2537299
Private Sub lblLabel_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
   If Button = vbRightButton Then
      controltype = "label"
      frmMain.PopupMenu mnuPopUpLabelAttributes
   End If
End Sub


This is the code you would use to make a "right button click" on a label  using the menu editor  tool you would make a label such as I have here "mnuPopUpLabelAttributes" underneath the rest of your other normal menus- the only difference is that you make its property invisible(visible is not checked) and put your subdivisions such as calender and etc underneath appropriately this will allow you to call  the frmMain.PopupMenu  mnuyourlabel with the right mouse button.......
0
 
LVL 1

Accepted Solution

by:
okcman earned 100 total points
ID: 2537315
&File
....&Quit
&Help
....&Help
&Attributes      <-this one invisible
....Calender
....Calculater
....My Special Function

A little further discussion of this to clarify in the menu editor, &attributes is the name I chose for mnuPopUpLabelAttributes - this is the spot where everything underneath will show up...but itself wont show up....
dont forget to mark the spot where you want to show in the popup menu by marking it invisible.....
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:okcman
ID: 2537321
Private Sub lblLabel_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
   If Button = vbRightButton
      frmMain.PopupMenu mnuPopUpLabelAttributes
   End If
End Sub

some corrected code the controltype="label" was for some other project I did....
0
 
LVL 6

Expert Comment

by:Marine
ID: 2537330
I can send you a code usinsg API which is a nice code its not required you to use Menu Editor. and whats good about it is that you can put in in a module some place and call it from whatever you want. Its rather big to past it here. If you give me your email i'd be glad to send it to you.
0
 
LVL 1

Expert Comment

by:okcman
ID: 2539095
hey are you there rossel?
0
 

Author Comment

by:rossel
ID: 2540463
In the solution from okcman you need to place a piece of code on every form and even on every object. I know that way. What I need is a kind of general call to a function wich gives the pop-up.
My email is r.rossel@modulo.nl
0
 
LVL 6

Expert Comment

by:Marine
ID: 2540487
Ok, I've sended you that exaple.Very nice code it was originally written by Klaus person. Nice code as well.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With a software solution, you always get to control email signatures and have the final say on the design - not an unrelated department or the uninterested end user.
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question