Solved

pop-up

Posted on 2000-02-18
8
464 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
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…

713 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