Ubacivanjem webbrowser kontrole na formu i postavljanja eventa htmlDocument objekta npr za onclick ili ocselectstart gube se ostali eventi na html strani koja potom ne moze da prihvata slova u text polja ni da otvara linkove. Dolje je problematisni kod
mshtml.HTMLDocument doc;
mshtml.HTMLDocumentEvents2_Event iEvent;
private void Form1_Load(object sender, System.EventArgs e)
{
object oURL = Application.StartupPath + "\\Strana.htm";
object oEmpty = "";
wbSer.Navigate2(ref oURL, ref oEmpty, ref oEmpty, ref oEmpty, ref oEmpty);
}
private void wbSer_DocumentComplete(object sender, AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
doc = (mshtml.HTMLDocument)wbSer.Document;
iEvent = (mshtml.HTMLDocumentEvents2_Event) doc;
iEvent.onclick += new mshtml.HTMLDocumentEvents2_onclickEventHandler(ClickEventHandler);
iEvent.onselectstart += new mshtml.HTMLDocumentEvents2_onselectstartEventHandler(Sel);
}
private bool Sel(mshtml.IHTMLEventObj e)
{
e.returnValue = false;
return false;
}
private bool ClickEventHandler(mshtml.IHTMLEventObj e)
{
listBox1.Items.Insert(0, e.type + ":" + e.srcElement.tagName);
e.returnValue = true;
return true;
}
Pomoc?