Solved

show control on Pop-Up Menu

Posted on 2000-05-04
8
181 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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

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

Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
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…
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…

719 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