Results 1 to 3 of 3

Thread: how do I make a button that links to a web page?

  1. #1
    Guest

    Post

    How do I create a button in my application that when pressed, it opens that url in the
    default web browser? I know it is probably
    simple, but I need help.

  2. #2
    Member
    Join Date
    Feb 1999
    Location
    ,Mo,USA
    Posts
    36

    Post

    Hey- the code is

    Shell "start <A HREF="http://www.PageToOpen.com"" TARGET=_blank>www.PageToOpen.com"</A>

    note: i dont think this works on NT

    Thnx for your time,
    CarlosTheJackal

  3. #3
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173

    Post

    What you really want to use is the ShellExecute API call. It looks like this:

    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    Use it like this to launch a web url:

    Call ShellExecute(0&, vbNullString, "http://www.vbsquare.com/", vbNullString, vbNullString, vbNormalFocus)

    ------------------
    "To the glory of God!"

Posting Permissions

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



Click Here to Expand Forum to Full Width