Solved

show control on Pop-Up Menu

Posted on 2000-05-04
8
171 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Read about the 3 stages of the buyer's journey: awareness, consideration, and decision.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

867 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

20 Experts available now in Live!

Get 1:1 Help Now