Hi,
I have a webbbrowser control that navigates to a page that contains an image,
and i want to hide or delete this image from my webbrowser.
I've tried to set on DocumentCompleted event the method below with no luck:
webBrowser1.Document.GetElementById("imgToHide").Style = "display:none";
How to hide an htmlelement from a webbrowser control?
My programing language is C#.
Below is my code:
private void Form_Load(object sender, EventArgs e)
{
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser1.Navigate(oURL);
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
//imgCancel is the name of t he image to hide
webBrowser1.Document.GetElementById("imgCancel").Style = "display:none";
}