Results 1 to 11 of 11

Thread: Text link

  1. #1

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    how do i make a label that when clicked it will open a new IE window and goto an address i specified?

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    I believe there is a tip on that...should be called something like, "creating hyperlinks in richtextbox's"...

  3. #3

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217

    Angry

    errrrr
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4
    Guest
    Try this:

    Code:
    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
    
    Public Const SW_SHOWNORMAL = 1
    
    Private Sub Label1_Click()
    ShellExecute Me.hwnd, vbNullString, "http://www.vb-world.net", vbNullString, "c:\", SW_SHOWNORMAL
    End Sub

  5. #5
    Guest
    If it's only IE then there's a much simpler way.

    First, add microsoft internet controls to your reference and:

    Code:
    Dim ie as New InternetExplorer
    
    ie.Navigate "URL"
    and you can have FULL control over IE.

  6. #6

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    doesnt work..
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  7. #7
    Guest
    Did you add Microsoft Internet Controls as a reference?

    Code:
    Dim ie as New InternetExplorer
    
    Private Sub Form_Load()
    ie.Navigate "http://www.vb-world.net"
    ie.Visible = True
    End Sub

  8. #8

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    what is a reference? I have the internet control on the form but it has an error
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  9. #9
    Guest
    That is why you get the error. You set it as a Custom Control.

    REFERENCE <> CUSTOM CONTROL

    Add it as a Reference, it should be above the Custom Control item on the menu.

  10. #10
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Nah, forget IE, use the ShellExecute method, doesn't take up resources and it easier to manage and also work for netscape (if that's the default browser, in fact in can be any program, as long as it's associated with URLS) so it reflects the users preference.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  11. #11
    Guest
    You are right about that Jop. I did post the code, but he didn't say anything, so I thought he wanted to use the Microsoft Internet Control as a reference.


    That just goes to show you, I'm right, as always .

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