name22

Link with labels - example

Aug 25th, 2014
231
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <GUIConstants.au3>
  2.  
  3. Global $iColor = 0x0645AD ;Farbe des Links
  4.  
  5. Global $sURL_1 = "http://www.google.de" ;URL des ersten Links
  6. Global $sURL_2 = "http://www.autoit.de" ;URL des zweiten Links
  7. Global $sCaption_1 = "Google" ;Text des ersten Links
  8. Global $sCaption_2 = "AutoIt" ;Text des zweiten Links
  9.  
  10. Global $hWnd_GUI = GUICreate("Link Label", 200, 80)
  11. Global $cLink_1 = GUICtrlCreateLabel($sCaption_1, 10, 20, 50, 20)
  12. GUICtrlSetColor(-1, $iColor)
  13. GUICtrlSetCursor(-1, 0)
  14. GUICtrlSetTip(-1, $sURL_1)
  15. Global $cLink_2 = GUICtrlCreateLabel($sCaption_2, 10, 45, 50, 20)
  16. GUICtrlSetColor(-1, $iColor)
  17. GUICtrlSetCursor(-1, 0)
  18. GUICtrlSetTip(-1, $sURL_2)
  19. GUISetState()
  20.  
  21. While True
  22.     Switch GUIGetMsg()
  23.         Case $GUI_EVENT_CLOSE
  24.             Exit
  25.         Case $cLink_1
  26.             ShellExecute($sURL_1)
  27.         Case $cLink_2
  28.             ShellExecute($sURL_2)
  29.     EndSwitch
  30. WEnd
RAW Paste Data