Build a web browser in VB6 without using Enter key

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

    Build a web browser in VB6 without using Enter key

    i am making a web browser and wont to be able to use The Enter key to affectively press go, if possible tell me the code or tell me where to start and what command to use ( i am using visual basic 6 )
  • gobblegob
    New Member
    • Dec 2007
    • 133

    #2
    add an Combobox ( this will be the address bar ) and name it CboUrl
    add a WebBrowser control and call it wWeb
    add a Command button called CmdGo
    then copy this code:

    Code:
    Private Sub CmdGo_Click()
        wWeb.Navigate CboUrl.Text
    End Sub
    Gobble.

    Comment

    • jamesd0142
      Contributor
      • Sep 2007
      • 471

      #3
      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

      • ooroboo
        New Member
        • Feb 2008
        • 20

        #4
        Originally posted by jamesd0142
        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]
        i tried using both codes and none seemed to work for me thanks for trying , not sure if i understood fully

        Comment

        • jamesd0142
          Contributor
          • Sep 2007
          • 471

          #5
          Originally posted by ooroboo
          i tried using both codes and none seemed to work for me thanks for trying , not sure if i understood fully
          This code basically checks the asci code of every key thats pressed when the textbox is being used.

          if the enter key is pressed the code executes.

          You understand that you need to double click the textbox and change from text changed event to keypress event ... right?

          Comment

          • ooroboo
            New Member
            • Feb 2008
            • 20

            #6
            Originally posted by ooroboo
            i tried using both codes and none seemed to work for me thanks for trying , not sure if i understood fully
            ahh don't worry , i retyped some of the code made a few minor changes and it works thank you

            i understand the process more and on adding more keys that preform tasks

            and yes i did forget to change to key press :P only started vb today

            Comment

            • gobblegob
              New Member
              • Dec 2007
              • 133

              #7
              Originally posted by ooroboo
              ahh don't worry , i retyped some of the code made a few minor changes and it works thank you

              i understand the process more and on adding more keys that preform tasks

              and yes i did forget to change to key press :P only started vb today

              Your welcome hope your having fun
              <<<Gobble>>>

              Comment

              Working...