is the web browser control...

TheBeastinator

New member
Sep 18, 2012
14
0
0
Visit site
Hey

So i was busy messing with the web browser control, and to my surprise... The control is EXTREMELY limited!
Does it really have no "Forward, Back, Refresh, Stop Loading" the very basics?
 

Red Lemur

New member
Oct 23, 2011
42
1
0
Visit site
It has all that - you just need to know how ;) These are from memory but should give you a rough idea.

e.g. refresh you can do by just navigating to the existing url:
Code:
MyBrowser.Navigate(MyBrowser.Source);

'Back'/'Forward' you can do by invoking JavaScript on the browser:
Code:
MyBrowser.InvokeScript("eval", "history.go(-1)");
(You may want to check first in your code there is something to go back to)

and Stop is a case of subscribing to the webbrowsercontrol's Navigating event and setting e.Cancel equal to true.
Code:
private void MyBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
     e.Cancel = true;
}

Hope that helps,

Ian
 
  • Like
Reactions: Jay Bennett

TheBeastinator

New member
Sep 18, 2012
14
0
0
Visit site
It has all that - you just need to know how ;) These are from memory but should give you a rough idea.

e.g. refresh you can do by just navigating to the existing url:
Code:
MyBrowser.Navigate(MyBrowser.Source);

'Back'/'Forward' you can do by invoking JavaScript on the browser:
Code:
MyBrowser.InvokeScript("eval", "history.go(-1)");
(You may want to check first in your code there is something to go back to)

and Stop is a case of subscribing to the webbrowsercontrol's Navigating event and setting e.Cancel equal to true.
Code:
private void MyBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
     e.Cancel = true;
}

Hope that helps,

Ian
oooohhhh i see... so we invoke java script.

Thanks, i feel quite silly missing these obvious steps.
 

Members online

Forum statistics

Threads
323,278
Messages
2,243,563
Members
428,055
Latest member
graceevans