Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[SOLVED] GUIcontextmenu and Menu


  • Please log in to reply
3 replies to this topic
totalmig
  • Members
  • 151 posts
  • Last active: May 20 2010 09:27 AM
  • Joined: 22 Jul 2008
Hi again.

I'm trying to make a menu that will pop up whenever the user right-clicks anywhere in the GUI, i've figured out from the helpfile that i should use GUIcontextmenu, but i havn't been able to figure out which syntax to use to actually link a menu being showed when guicontextmenu is launched.

Anyone able to point me in the right direction?

Thanks again.[/code]

ih57452
  • Members
  • 70 posts
  • Last active: Nov 26 2014 01:26 PM
  • Joined: 06 Feb 2010
;~ Create the menu:

Menu, menu1, Add, Thing 1, label1

Menu, menu1, Add, Thing 2, label2

Gui, Show, w400 h400

Return



;~ Show the menu when you right-click:

GuiContextMenu:

Menu, menu1, Show, %A_GuiX%, %A_GuiY%

Return



;~ Do something when you click the menu:

label1:

MsgBox, You clicked 1.

Return



label2:

MsgBox, You clicked 2.

Return



GuiClose:

ExitApp


totalmig
  • Members
  • 151 posts
  • Last active: May 20 2010 09:27 AM
  • Joined: 22 Jul 2008
Thanks alot :)

jjohnston2
  • Members
  • 13 posts
  • Last active: Aug 23 2015 07:20 AM
  • Joined: 03 Aug 2012

Worked perfectly... thank you for posting