Solved

show control on Pop-Up Menu

Posted on 2000-05-04
8
168 Views
Last Modified: 2013-11-28
How do I show a control on Pop-Up Menu?

I know how to make a popup menu but I need a control or two
on it. Like maybe a combobox, or perhaps labels to click, or???
I'm tired of just having text on popup menus.

This will be used on a richtextbox sitting on a SSTab.
I can easily bring up the menu with a right click.
How do I add controls?    (no ocx's please).
0
Comment
Question by:jgore
8 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2778860
0
 
LVL 6

Expert Comment

by:Marine
ID: 2778864
it would take subclassing to do this and probably a lot of it to get this done.
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2778867
The following code would be used to display the Format menu when the user clicks the right mouse button on any open area of the form:

Private Sub Lable1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
    Me.PopupMenu popFormat
End If
End Sub


Place the code for the PopupMenu method in the MouseDown or MouseUp(((((typically the MouseUp))))) event of the form.

pop-up menu named popFormat

Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
    Me.PopupMenu popFormat
End If
End Sub
0
 
LVL 5

Expert Comment

by:AnswerTheMan
ID: 2779160
if you are ready for some hard work - build you own menu.
it can be made on any container that you can place controls on (picBox, form,frame). prepare it as you need - and "popup" it in the right location and time.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:jgore
ID: 2779349
To AzraSound:
I don't want to show a menu for a  button.
I wan't to put a control on a menu.

To Ruchi:
I don't get it. How is that going to put a control on a menu? Looks like your just calling up a menu. I can do
that. I just can't call one up with a combo box or something on it.

To AnswerTheMan:
I would love to do that. I even started to do it.
But, I can't make the second form (my container, hadn't thought of using a pic box or frame) show up where the mouse is!  I tried all kinds of things!

Private Sub richtext1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

If Button And vbRightButton Then
   Form2.Top = y
   Form2.Left = x
   Form2.Show    ' Show PopUp Menu
End If
End sub

heh, that doesn't work!
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 50 total points
ID: 2779459
yes frame can be used here(sorry i misread your question)

for example, put a frame on the form and add three command buttons to it...be sure the command buttons are contained in the frame.  after doing that, set the frame's borderstyle to none and its visible property to false.  then you can implement the code like this:



Private Sub richtext1_Click()
    Frame1.Visible = False
End Sub

Private Sub richtext1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbRightButton Then
        Frame1.Left = richtext1.Left + X
        Frame1.Top = richtext1.Top + Y
        Frame1.Visible = True
    End If
End Sub
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2779462
naturally there may be more events that need to set the frame's visible property to false in the case the user doesnt click back into your richtextbox.
0
 

Author Comment

by:jgore
ID: 2779549
That works for me!
I was using a second form but I like frame much better. This way focus stays on  form1.
After looking at your example I don't know why
I didn't figure it out in a second! hehe
Thanks again!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Window placement 17 64
Access 2016 VB code 9 86
bit defender blocks good applications 2 52
using web browser with BING 40 86
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.
Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:

707 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

15 Experts available now in Live!

Get 1:1 Help Now