Question Include textbox value in WebBrowser URL?

BrockBarr

New member
Joined
Feb 4, 2011
Messages
1
Programming Experience
Beginner
Hi,

I have been trying for several hours now, and still no luck.

I am creating a program to do an enormous amount of tasks, and I'm embarrassed to say this is the only thing I'm having trouble with!

I have a TextBox, with an id of 'reg'. Now, i also have a button (button1). On button click, i want it to open a separate Windows Form that has a web browser in it. (That's the easy part!).

I also make it navigate to a certain URL, which has a search function. What i am trying to do, is have VB give the value of the textbox (reg.Text) to the web browser, INSIDE the URL. Here's what i have so far;

home.vb

Code:
reg_expl.Show()
        reg_expl.WebBrowser1.Navigate("http://www.casa.gov.au/scripts/airsresults.asp?framein=all&manuin=&modelin=&regholdin=&regopin=&serialin=&num_results=10&VHin=[U][B](reg.Text)[/B][/U]&Search=Search&session=1550168471")
        reg_expl.WebBrowser1.AllowNavigation = False
where (reg.Text) appears, i want it to be the actual value of the textbox. i have tryed several methods, but it will will not co-operate :mad:.

Any help would be excellent!

Regards,
Brock
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,171
Location
Sydney, Australia
Programming Experience
10+
The Text property of a TextBox is a String. If you want to join two Strings together then you use the concatenation (&) operator. You can also insert values into Strings using the String.Format method.
 
Top Bottom