C# windows form application allow you to browse any webpage in windows form application. for doing so just add webbrowser Control to your form and set a text box for URL where user will enter there URL. Drop a button when user click that button so that your form's web Browser should navigate to the URL in text box in form.
Now to navigate to a web page use the following Program . Web Browser navigation works as follow:
Go to onclick Event of the button used in your program to start navigation now use the following code
webbrowser1.navigate(textbox1.text);
and this how your URL from Textbox1 will be navigated in Browser.
NOTE : You can also add Go back and go Forward Buttons to your new web Browser for that purpose use the following code.
if(webbrowser1.CanGoBack)
{
webbrowser1.GoBack();
}
if(webbroswer1.CanGoForward)
{
webbroswer1.GoForward();
}
Now to navigate to a web page use the following Program . Web Browser navigation works as follow:
Go to onclick Event of the button used in your program to start navigation now use the following code
webbrowser1.navigate(textbox1.text);
and this how your URL from Textbox1 will be navigated in Browser.
NOTE : You can also add Go back and go Forward Buttons to your new web Browser for that purpose use the following code.
if(webbrowser1.CanGoBack)
{
webbrowser1.GoBack();
}
if(webbroswer1.CanGoForward)
{
webbroswer1.GoForward();
}
No comments:
Post a Comment