Results 1 to 2 of 2

Thread: Google Search Bar

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2007
    Posts
    58

    Google Search Bar

    I want to make a Google Search bar in my program, i want it to take the textbox and change that into google's link.

    So first put http://www.google.co.uk/search?hl=en&q=
    Then change all the spaces to a +
    And finally add btnG=Google+Search&meta=

    So if i were to type 1 2 3 4

    It would give me a string of
    http://www.google.co.uk/search?hl=en...G=Search&meta=

    Which i could then navigate to. But how do i do this and put all spaces to a +

  2. #2
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Google Search Bar

    Use the "replace" method of the string object which repaces any given substring with a specified replacement.

    ie if you had textbox1 which had your search term and textbox2 which holds the amended string you'd want something like :

    Code:
    TextBox2.Text =  "http://www.google.co.uk/search?hl=eng&q+" & TextBox1.Text.Replace(" ", "+") & "G=Google+Search&meta="

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