|
-
Aug 24th, 2000, 05:57 PM
#1
Thread Starter
Addicted Member
-
Aug 24th, 2000, 06:15 PM
#2
Take a look at this thread which answers your queston. Not sure if it will work the same for an MDI form though.
-
Aug 25th, 2000, 03:43 PM
#3
_______
<?>
Code:
'code is compliments of ameba at ExpertsExchange
'make a popup menu just like the one's in windows
'appear at the right click of your mouse as long
'as your right click is on the form
Option Explicit
Private Sub Form_Load()
mnuPop.Visible = False
End Sub
'
'allow users the ability of win keyboard menu key
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 93 Then
'fire up the popup menu
PopupMenu mnuPop, 2, 60, 60
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
'fire up the popup menu
PopupMenu mnuPop, 2, X, Y
End If
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 10th, 2001, 07:08 AM
#4
Hyperactive Member
Use this:
Code:
'Declaration
Public Declare Function SetForegroundWindow Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
set this form as current window, otherwise popup
'menu will stay on the screen even after you click
'outside it
Call SetForegroundWindow(Me.hwnd)
PopupMenu frmMain.mnuconfigure
End Sub
Craig Johnstone, MCP,CNA
VB 6,SQL,Lotus Notes,Crystal Reports 7,8
http://www.cajsoft.co.uk/downloads.htm
-
Sep 10th, 2001, 07:32 AM
#5
Registered User
Who ressurected this old thread?
-
Sep 10th, 2001, 07:36 AM
#6
Hyperactive Member
I took me a long time to find out how to acomplish it so I thought I'd post it anyway, incase anyone searches for a way to remove the menu.
Plus, I didnt even look at the date
Craig Johnstone, MCP,CNA
VB 6,SQL,Lotus Notes,Crystal Reports 7,8
http://www.cajsoft.co.uk/downloads.htm
-
Sep 10th, 2001, 07:38 AM
#7
I've had similar problems, and I solved it with this (even though it sounds somewhat unconventional)
Make the last menu item of your popup menu and item called
Cancel Menu
Put nothing in its click event.
Bring the menu up, and click on Cancel Menu.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|