CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Browser

  1. #1
    Join Date
    Jul 2001
    Posts
    2

    Browser

    How do you make a browser window open to a specified URL when you click a command button?


  2. #2
    Join Date
    May 2001
    Posts
    155

    Re: Browser

    Do you mean the browser active X control?

    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

  3. #3
    Join Date
    May 2001
    Location
    Canada
    Posts
    182

    Re: Browser

    Add a WebBrowser control on your form first. If you can not find the control, add "Microsoft Internet Controls" component into your toolbox.

    Then add one text box, one command button on your form.
    =========
    Private Sub Command1_Click()
    On Error Resume Next 'Don't stop execution, continue on next line
    WebBrowser1.Navigate Text1.Text
    If Err.Number <> 0 Then MsgBox "Error :" & Err.Description 'Display error message
    End Sub
    ========



    Regards,

    Michi
    MCSE, MCDBA

  4. #4
    Join Date
    Apr 2000
    Posts
    737

    Re: Browser

    put this in the button click event handler, where URL is the URL string.

    ShellExecute(me.hWnd, "Open", URL, "", App.Path, 1)


    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

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

Featured