Shortcut list

masoud_sedighy

Registered User.
Local time
Today, 12:56
Joined
Dec 10, 2011
Messages
132
Before I have a question about how I can have a shortcut option when right click on each item on the list box.​
So I got my answer with below code that opens another form "frmshortcut" with a listbox inside that shows list of options like "new task" , "edit item" .​
Now my problem is (like attached picture) the shortcut list (frmshortcut) will be open in another place when I right click the mouse, it is far from location of click.​
Also it shows some default in access when I right click in the listbox ("subform", "cut", "copy"), actually I do not like it shows these, just I like it shows shortcut list I have defined by the list box.​
Private Sub ItemList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)​
Const RIGHTBUTTON = 2​
[FONT=&quot][/FONT]​
If Button = RIGHTBUTTON Then​
DoCmd.OpenForm "frmshortcut"​
' DoCmd.OpenForm "frmshortcut", acNormal, , , , acDialog​
Forms!frmshortcut!txtparameter = Me.ItemList.Value​
End If​
End Sub​
 

Attachments

  • shortcut.jpg
    shortcut.jpg
    83.4 KB · Views: 86
You should catch the mouse coordinates then to move the form according with this coordinates.
To move the form is a simple task (MoveSize instruction). So you must find out how to catch the mouse coordinate inside the Access window.
 

Users who are viewing this thread

Back
Top Bottom