taotao878 Posted February 25, 2008 Share Posted February 25, 2008 How do I create this HyperLink ? Please look the attachment. Link to comment Share on other sites More sharing options...
smashly Posted February 25, 2008 Share Posted February 25, 2008 (edited) Hi, #include <GUIConstants.au3> Global $Last $Gui = GUICreate(":)", 120, 50) $Label = GUICtrlCreateLabel("Version, Blah, Blah" & @LF & "Technical: Yada, Yada", 5, 5, 110, 25) GUICtrlSetColor(-1, 0x0000FF) $Link = GUICtrlCreateLabel("www.autoitscript.com", 5, 30, 110, 15) GUICtrlSetColor(-1, 0x0000FF) GUISetState(@SW_SHOW, $Gui) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Link ShellExecute(GUICtrlRead($Link)) Case Else $GGCI = GUIGetCursorInfo($Gui) If $GGCI[4] = $Link And $Last <> $Link Then GUICtrlSetFont($Link, Default, Default, 6) $Last = $Link ElseIf $GGCI[4] <> $Link And $Last = $Link Then GUICtrlSetFont($Link, Default, Default, Default) $Last = 0 EndIf EndSwitch WEnd Cheers Edited February 25, 2008 by smashly Link to comment Share on other sites More sharing options...
rasim Posted February 25, 2008 Share Posted February 25, 2008 More examples: expandcollapse popup#include <GuiConstants.au3> Global $aCurPos[5] Dim $Flag = 1 $hGui = GuiCreate("Main GUI", 300, 200) $Menu1 = GUICtrlCreateMenu("&File") $Menu2 = GUICtrlCreateMenu("&Options") $Menu3 = GUICtrlCreateMenu("&Help") $Item1 = GUICtrlCreateMenuItem("User manual", $Menu3) $Item2 = GUICtrlCreateMenuItem("About", $Menu3) ;About child GUI $AboutGUI = GUICreate("About...", 200, 100, -1, -1, -1, $WS_EX_TOOLWINDOW, $hGui) GUICtrlCreateLabel("Version 1.0 (Build 12)" & @CRLF & _ "Technical support: support@zhangduo.com", 40, 10, 120, 40) $URL_Label = GUICtrlCreateLabel("Website: http://drv.n3.net", 40, 55, 140, 15) GUICtrlSetCursor(-1, 0) GUISetState(@SW_SHOW, $hGui) While 1 $msg = GUIGetMsg(1) $aCurPos = GUIGetCursorInfo($AboutGUI) If $aCurPos[4] = $URL_Label And $Flag = 1 Then GUICtrlSetFont($URL_Label, Default, 400, 2) GUICtrlSetColor($URL_Label, 0xFF0000) $Flag = 0 ElseIf $aCurPos[4] <> $URL_Label And $Flag = 0 Then GUICtrlSetFont($URL_Label, Default, 400, 1) GUICtrlSetColor($URL_Label, 0x000000) $Flag = 1 EndIf Select Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $hGui ExitLoop Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $AboutGUI GUISetState(@SW_ENABLE, $hGui) GUISetState(@SW_HIDE, $AboutGUI) Case $msg[0] = $Item2 GUISetState(@SW_DISABLE, $hGui) GUISetState(@SW_SHOW, $AboutGUI) Case $msg[0] = $URL_Label $url = StringRegExp(GUICtrlRead($URL_Label), "http.*", 1) ShellExecute($url[0]) EndSelect WEnd Link to comment Share on other sites More sharing options...
taotao878 Posted February 25, 2008 Author Share Posted February 25, 2008 (edited) Thanks! But if I use "OnEvent" Mode, How do I ? Edited February 25, 2008 by taotao878 Link to comment Share on other sites More sharing options...
smashly Posted February 25, 2008 Share Posted February 25, 2008 (edited) Hi,expandcollapse popup#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) Global $Last $Gui = GUICreate(":)", 120, 50) $Label = GUICtrlCreateLabel("Version, Blah, Blah" & @LF & "Technical: Yada, Yada", 5, 5, 110, 25) GUICtrlSetColor(-1, 0x0000FF) $Link = GUICtrlCreateLabel("www.autoitscript.com", 5, 30, 110, 15) GUICtrlSetOnEvent(-1, "Event") GUICtrlSetColor(-1, 0x0000FF) GUISetOnEvent($GUI_EVENT_CLOSE, "Event", $Gui) GUISetState(@SW_SHOW, $Gui) While 1 Sleep(100) $GGCI = GUIGetCursorInfo($Gui) If $GGCI[4] = $Link And $Last <> $Link Then ; GUICtrlSetFont($Link, Default, Default, 6) $Last = $Link ElseIf $GGCI[4] <> $Link And $Last = $Link Then GUICtrlSetFont($Link, Default, Default, Default) $Last = 0 EndIf WEnd Func Event() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE Exit Case $Link ShellExecute(GUICtrlRead($Link)) EndSwitch EndFuncoÝ÷ ØêÚºÚ"µÍÚ[ÛYH ÑÕRPÛÛÝ[Ë]LÉÝÂÜ ][ÝÑÕRSÛ][[ÙI][ÝËJBÛØ[ ÌÍÓÝÌÍÑÝZHHÕRPÜX]J ][ÝÎI][ÝËL L BÌÍÓX[HÕRPÝÜX]SX[ ][ÝÕÚ[ÛZZ ][ÝÈ [È [È ][ÝÕXÚXØ[XYKXYI][ÝË K KLLJBÕRPÝÙ]ÛÛÜLKBÌÍÓ[ÈHÕRPÝÜX]SX[ ][ÝÝÝÝË]]Ú]ØÜÛÛI][ÝË KÌLLMJBÕRPÝÙ]Û][ LK ][ÝÑ][ ][ÝÊBÕRPÝÙ]ÛÛÜLKBÕRTÙ]Û][ ÌÍÑÕRWÑUSÐÓÔÑK ][ÝÑ][ ][ÝË ÌÍÑÝZJBÕRTÙ]Ý]JÕ×ÔÒÕË ÌÍÑÝZJBYX[XJ ][ÝÓ[ÝÙSÝ][ÝËL BÚ[HBTÛY L BÑ[[È[ÝÙSÝ BIÌÍÑÑÐÒHHÕRQÙ]ÝÛÜ[Ê ÌÍÑÝZJBRY ÌÍÑÑÐÒVÍHH ÌÍÓ[È[ ÌÍÓÝ ÉÝÈ ÌÍÓ[È[ÈBQÕRPÝÙ]Û ÌÍÓ[ËY][Y][ BBIÌÍÓÝH ÌÍÓ[ÂQ[ÙRY ÌÍÑÑÐÒVÍH ÉÝÈ ÌÍÓ[È[ ÌÍÓÝH ÌÍÓ[È[BBQÕRPÝÙ]Û ÌÍÓ[ËY][Y][Y][ BBIÌÍÓÝHQ[Y[[Â[È][ BTÝÚ]ÚÕRWÐÝYBPØÙH ÌÍÑÕRWÑUSÐÓÔÑBBBQ^]BPØÙH ÌÍÓ[ÂBBTÚ[^XÝ]JÕRPÝXY ÌÍÓ[ÊJBQ[ÝÚ]Ú[[ Cheers Edited February 25, 2008 by smashly Link to comment Share on other sites More sharing options...
taotao878 Posted February 25, 2008 Author Share Posted February 25, 2008 Thank you very much ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now