Solved

pop-up

Posted on 2000-02-18
8
461 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now