Adblock breaks this site

Help with GoSerach function

Discussion in 'Programming General' started by Renegades009, Sep 10, 2008.

  1. Renegades009

    Renegades009 Forum Addict

    Joined:
    Feb 28, 2007
    Posts:
    274
    Referrals:
    0
    Sythe Gold:
    0
    Help with GoSerach function

    Hi im using this code WebBrowser1.GoSearch(TextBox3.Text) To try and search the info in a text box next to it but its giving me this error. To many arguments to public sub GoSearch(). Any Ideas?
     
  2. Flaming Idiots

    Flaming Idiots Active Member
    Visual Basic Programmers

    Joined:
    Dec 22, 2005
    Posts:
    235
    Referrals:
    1
    Sythe Gold:
    0
    Two Factor Authentication User
    Help with GoSerach function

    GoSearch goes to the default search page. If you want to search use this:

    WebBrowser.Navigate("search " & SearchTextBox.Text)


    Also, you should use more descriptive names (ie. SearchTextBox) for your controls. Makes it much easier to code when your forms have a lot of controls.
     
  3. Renegades009

    Renegades009 Forum Addict

    Joined:
    Feb 28, 2007
    Posts:
    274
    Referrals:
    0
    Sythe Gold:
    0
    Help with GoSerach function

    Dude thanks you very much as you see im a noob. No theres one other promblem it compiles but when i try and search it brings up page cannot be displayed any ideas?
     
  4. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    Help with GoSerach function

    You should actually be using something like this for example to search Google...

    Example Code to search using the textbox
    Code:
    WebBrowser.Navigate("http://www.google.ca/search?hl=en&q=" & SearchTextBox.Text)
    Example of multi-term search URL where it's searching for "Hello" and "Hi"
    Code:
    http://www.google.ca/search?hl=en&q=Hello+Hi
    You'll have to make it replace the spaces in your Textbox string with +'s for it to search multiple terms. Hope this was understandable, it's quite easy to do it for most other search engines too.
     
  5. Renegades009

    Renegades009 Forum Addict

    Joined:
    Feb 28, 2007
    Posts:
    274
    Referrals:
    0
    Sythe Gold:
    0
    Help with GoSerach function

    Hey nullware i was thinking of something like that. But ive moved on to other projects but thanks anyway.
     
< Drag Effect? | Htaed auto clicker. >


 
 
Adblock breaks this site