Results 1 to 4 of 4

Thread: how to create a hyperlink

  1. #1
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    how to create a hyperlink

    Is there a way to create a hyperlink in thinbasic. I want to show a control (image or a label) and if the user click on this, it should open the hyperlink in user's default browser. Is that possible and how? Couldn't find this in the examples.

    Martin

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Martin,

    there are (at least) two ways to do it. For labels, you can directly use TBURL32 control, which already looks as hyperlink. It is used for example in SampleScripts\UI\TextBox\TextBox.tBasic.

    The second, more general way, is to shell default browser:
    USES "OS"
    
    OS_ShellExecute("open", "http://www.thinbasic.com", "", "", 1)
    
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40
    Thanks a lot Petr, TBURL32 control is exactly what i was looking for! Is it also possible to change the text and URL, like "Control Set Text" ?

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi,

    yes, it is possible. Just set the text following the same rules as for the creation (separate text and label using semicolon):
    CONTROL SET TEXT hDlg, %ID_Url, "Visit Google;http://www.google.com"
    

    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. How to create a new SDK?
    By Michael Hartlef in forum Turbo Delphi language SDK development
    Replies: 2
    Last Post: 30-11-2008, 13:46
  2. Can thinbundle create a console exe?
    By Michael Hartlef in forum thinBundle suggest new features
    Replies: 31
    Last Post: 01-06-2007, 09:48
  3. Directory where to create bundled exe
    By ErosOlmi in forum thinBundle suggest new features
    Replies: 0
    Last Post: 21-02-2007, 00:43

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •