Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

rightclicking...

Posted on 1999-06-29
11
Medium Priority
?
336 Views
Last Modified: 2010-05-02
I found something interesting.

Generally in most programs.
When I rightclick my mouse a popup menu pops up.
and somewhere outside the popup menu a popmenu appears.

but this code have some problems.
If I run this code,
I have to LEFTCLICK outside the popupmenu.

What should I do if I want to popup a menu by just RIGHTCLICKing somewhere.

My code is as follows.
===================
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbRightButton Then
        PopupMenu mnuFile, vbPopupMenuLeftAlign
    End If

End Sub
===================

Is this obscure?
I hope not.

Thank you.
0
Comment
Question by:iamjhkang
[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
11 Comments
 
LVL 1

Author Comment

by:iamjhkang
ID: 1520842
Edited text of question.
0
 
LVL 1

Author Comment

by:iamjhkang
ID: 1520843
Edited text of question.
0
 
LVL 1

Expert Comment

by:Maquiavelo
ID: 1520844
 Hi, I don't get exactly what you mean?
  The code you posted doesn't work???
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

Author Comment

by:iamjhkang
ID: 1520845
OK.
Let me explain it.

You are running IE or Navigator.

Rightclick now any where.
and rightclick somewhere else.
and then the popupmenu follows the mouse point without any other action other than rightclicking, doesn't it?

but in the code above if you rightclicked once you MUST click the leftbutton in order to turn popupmenu up somewhere else.

Get it?
Hope so.
0
 

Expert Comment

by:NiTech
ID: 1520846
Wicked.

Change the code to form1_mousedown() and see whether it changes. May be windows bugging?

see ya
Nit-
0
 
LVL 1

Author Comment

by:iamjhkang
ID: 1520847
Thanks NiTech.

You know what I mean.

Foget mousedown.

0
 
LVL 1

Expert Comment

by:wolfjjj
ID: 1520848
I just use the following code and it works fine

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
        PopupMenu mnuFile
    End If
End Sub

0
 
LVL 2

Expert Comment

by:DavidMartin
ID: 1520849
PopupMenu mnutest, vbPopupMenuLeftAlign Or vbPopupMenuRightButton, X, Y
0
 
LVL 1

Author Comment

by:iamjhkang
ID: 1520850
Thank you very much DavidMartin.

Your answer DID the trick.
0
 
LVL 2

Accepted Solution

by:
DavidMartin earned 120 total points
ID: 1520851
Here's my answer, for the points:)

PopupMenu mnutest, vbPopupMenuLeftAlign Or vbPopupMenuRightButton, X, Y
0
 
LVL 1

Author Comment

by:iamjhkang
ID: 1520852
Sorry DavidMartin.

I thought I gave 30 points.
but...

There must be something wrong.

Sorry 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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

660 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