Jump to content

Recommended Posts

I'm trying to make a clickable link in a GUI with the following code:

#include <GUIConstantsEx.au3>

Opt("GUIOnEventMode", 1)

$hGUI = GUICreate("Test", 300, 200)
$label = GUICtrlCreateLabel("www.autoitscript.com", 50, 80, 200, 30)
GUICtrlSetFont(-1, 16, 100, 4)
GUICtrlSetColor(-1, 0x000000)


GUICtrlSetCursor($label,0) 
GUISetOnEvent($label, "labelFun")

GUISetState()

; set loop to make GUI persistent:
While 1
   sleep(100)
WEnd

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Func labelFun()
   ConsoleWrite("label clicked" & @CRLF)
   ShellExecute('http://www.autoitscript.com') ; open web site when clicking label
EndFunc

I don't even have a suggestion for why this doesn't work, I'm very confused! Thanks for any help offered

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

×
×
  • Create New...