Jump to content
Sign in to follow this  
adamchapman

clickable GUI label

Recommended Posts

adamchapman

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

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  

  • Similar Content

    • meomeo192
      By meomeo192
      Hi all,
      I tried function _FFLinkClick() in FF.au3. And i have a problem, i intend click 2 or more links, when use _FFLinkClick() to click links (after click the link will be opened a new tab), i must wait the first load finish to click the second link.
      Anybody can tell me the wait set time out when click link in firefox, I want after click the first link, i can click the second link now, without must not wait the first link load finish.
      Thank all very much.
    • DeathRow
      By DeathRow
      I want to automatize a 'click on a specific link' in a web browser window( I know for IE its a function for this )but I don't use IE ,I use Firefox. So how can I do this ?
      Or if I could click on a specific text it would be resolved. Can I find a specific text in a window and click on it ? o.O
×