need help making a web browser on vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ooroboo
    New Member
    • Feb 2008
    • 20

    need help making a web browser on vb6

    i wont to make so the enter key can submit the url, like on firefox and IE , when i press enter it takes me to website i typed in instead of pressing the button , i had a few guesses but i'm new to vb and got it wrongh

    any help would be great

    If keyascii = Keys.enter Then WebBrowser1.Nav igate(ComboBox1 .Text)
    End if

    thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Make the button default button and set the keypreview of the form to TRUE.

    Comment

    • ooroboo
      New Member
      • Feb 2008
      • 20

      #3
      still not working , but ty i probably didn't understand as i should of.

      can anyone give me a code? then i might be able to work round other problems

      Comment

      • jamesd0142
        Contributor
        • Sep 2007
        • 471

        #4
        Also in VB 2005, although there must be simular options in VB 6...

        I did this on the textbox keypress event...

        [code=vbnet]
        if asc(e.keychar) = "13" then
        btnGO.performcl ick
        end if
        [/code]

        Comment

        • gobblegob
          New Member
          • Dec 2007
          • 133

          #5
          in VB 6...

          Code:
          Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
           If KeyCode = vbKeyReturn Then
              WebBrowser1.Navigate Combo1.Text
           End If
          End Sub
          This will do the trick

          <<<Gobble>>>

          Comment

          Working...