Jump to content

How to create a button with menu?


Recommended Posts

context menu does the trick..

#include <GUIConstants.au3>

Opt("GUIOnEventMode",1)
$aa = GUICreate("",200,200,200,200)
$button = guictrlcreatebutton('context',1,1,98,45)
GUIctrlSetOnEvent(-1,'en')
$context = guictrlcreatecontextmenu($button)
$con1 = guictrlcreatemenuitem('la',$context)
$button2 = guictrlcreatebutton('close',1,50,98,45)
GUIctrlSetOnEvent(-1,'lukk')
guisetstate()

func lukk()
    exit
EndFunc

func en()
    mouseclick('right')
endfunc

while 1
    sleep(10)
Wend
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...