Jump to content
Sign in to follow this  
zhao

How to create a button with menu?

Recommended Posts

yxrkt

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

Share this post


Link to post
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
Sign in to follow this  

×