Jump to content

embed a URL-hyperlink within a GUI-lable


rudika
 Share

Recommended Posts

moin, moin...;)!

Does anyone know if and how it is possible to embed an URL-hyperlink, maybe with GUICtrlCreateIcon or GUICtrlCreateLable. I´d like to use it in my synchro tool. I always found every answer to all my questions within AutoIt.chm, but now I didn´t found anything about that case. Also there is no topic about this subject here in this forum.

Apart from that, is there a possible to create a button without borders and 3D-design? For that too, I didn´t found a Style or exStyle code in the appendix.

Thanks a lot :lmao:

Edited by rudika

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
Share on other sites

  • Moderators

This will give you an idea on how to create a hyperlink:

#include <GUIConstants.au3>

GUICreate("Link..", 200, 150, -1, -1)
$LABEL = _GuiCtrlCreateHyperlink("Website Link", 60, 75, 90, 20, 0x0000ff, "This is a website...")
GUISetState()
While 1
    $MSG = GUIGetMsg()
    Select
        Case $MSG = $GUI_EVENT_CLOSE
            Exit
        Case $MSG = $LABEL
            Run("explorer.exe http://google.com")
    EndSelect
WEnd
;===============================================================================
;
; Function Name:    _GuiCtrlCreateHyperlink()
; Description:    Creates a label that acts as a hyperlink
;
; Parameter(s):  $s_Text       - Label text
;                  $i_Left        - Label left coord
;                  [$i_Top]   - Label top coord
;                   [$i_Width]    - Label width
;                  [$i_Height]    - Label height
;                   [$i_Color]    - Text Color
;                   [$s_ToolTip]  - Hyperlink ToolTip
;                   [$i_Style]    - Label style
;                   [$i_ExStyle]  - Label extended style
;
; Requirement(s):   None
; Return Value(s):  Control ID
;
; Author(s):        Saunders <krawlie@hotmail.com>
;
;===============================================================================

Func _GuiCtrlCreateHyperlink($s_Text, $i_Left, $i_Top, $i_Width = -1, $i_Height = -1, $i_Color = 0x0000ff, $s_ToolTip = '', $i_Style = -1, $i_ExStyle = -1)
    Local $i_CtrlID
    $i_CtrlID = GUICtrlCreateLabel($s_Text, $i_Left, $i_Top, $i_Width, $i_Height, $i_Style, $i_ExStyle)
    If $i_CtrlID <> 0 Then
        GUICtrlSetFont($i_CtrlID, -1, -1, 4)
        GUICtrlSetColor($i_CtrlID, $i_Color)
        GUICtrlSetCursor($i_CtrlID, 0)
        If $s_ToolTip <> '' Then
            GUICtrlSetTip($i_CtrlID, $s_ToolTip)
        EndIf
    EndIf
    
    Return $i_CtrlID
EndFunc  ;==>_GuiCtrlCreateHyperlink
Link to comment
Share on other sites

This will give you an idea on how to create a hyperlink:

#include <GUIConstants.au3>

GUICreate("Link..", 200, 150, -1, -1)
$LABEL = _GuiCtrlCreateHyperlink("Website Link", 60, 75, 90, 20, 0x0000ff, "This is a website...")
GUISetState()
While 1
    $MSG = GUIGetMsg()
    Select
        Case $MSG = $GUI_EVENT_CLOSE
            Exit
        Case $MSG = $LABEL
            Run("explorer.exe http://google.com")
    EndSelect
WEnd
;===============================================================================
;
; Function Name:    _GuiCtrlCreateHyperlink()
; Description:    Creates a label that acts as a hyperlink
;
; Parameter(s):  $s_Text       - Label text
;                  $i_Left        - Label left coord
;                  [$i_Top]   - Label top coord
;                   [$i_Width]    - Label width
;                  [$i_Height]    - Label height
;                   [$i_Color]    - Text Color
;                   [$s_ToolTip]  - Hyperlink ToolTip
;                   [$i_Style]    - Label style
;                   [$i_ExStyle]  - Label extended style
;
; Requirement(s):   None
; Return Value(s):  Control ID
;
; Author(s):        Saunders <krawlie@hotmail.com>
;
;===============================================================================

Func _GuiCtrlCreateHyperlink($s_Text, $i_Left, $i_Top, $i_Width = -1, $i_Height = -1, $i_Color = 0x0000ff, $s_ToolTip = '', $i_Style = -1, $i_ExStyle = -1)
    Local $i_CtrlID
    $i_CtrlID = GUICtrlCreateLabel($s_Text, $i_Left, $i_Top, $i_Width, $i_Height, $i_Style, $i_ExStyle)
    If $i_CtrlID <> 0 Then
        GUICtrlSetFont($i_CtrlID, -1, -1, 4)
        GUICtrlSetColor($i_CtrlID, $i_Color)
        GUICtrlSetCursor($i_CtrlID, 0)
        If $s_ToolTip <> '' Then
            GUICtrlSetTip($i_CtrlID, $s_ToolTip)
        EndIf
    EndIf
    
    Return $i_CtrlID
EndFunc ;==>_GuiCtrlCreateHyperlink
yaaah... ;):lmao: that´s what I wanted

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
Share on other sites

  • 2 years later...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...