?
Solved

show control on Pop-Up Menu

Posted on 2000-05-04
8
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 

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 200 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Choosing a core focus or particular set of features and options can be tough. To help out, we’re going to highlight a handful of things your business needs on one of your social media pages. In other words, if one of these is missing, you should imp…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 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