I'm getting this error now on the line below:
C:\myFiles\mypr ogC#\Main\IE.cs (31): Method 'Mail.IE.IEDocC omplete(object,
ref object)' does not match delegate 'void System.EventHan dler(object,
System.EventArg s)'
[for this code]
IE_Inst.Documen tComplete += new System.EventHan dler(IEDocCompl ete);
[method defined here]
public void IEDocComplete(o bject pDisp, ref object url)
{
What exactly is it asking for?
Thanks,
Brett
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:ui******** ******@TK2MSFTN GP12.phx.gbl...
The .Paint part was just an example of a well-known event.
In your particular case you can declare the object and add the handler like
so:
AxSHDocVw.AxWeb Browser axWebBrowser1 = new AxSHDocVw.AxWeb Browser();
this.axWebBrows er1.DocumentCom plete += new
AxSHDocVw.DWebB rowserEvents2_D ocumentComplete EventHandler(th is.axWebBrowser 1_DocumentCompl ete);
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Brett" <no@spam.com> wrote in message
news:OQ******** ******@TK2MSFTN GP09.phx.gbl...
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. .. Don't worry about it. It's another example of keyword diarrhea in VB. It
fits right in with the idiocy of "overloads overrides" and the VB
compilers insistence on seeing the Readonly keyword even when it can see
that there is no set accessor.
If a class exposes public events then you can add a handler to them using
the += operator such as...
theForm.Paint+= new PaintEventHandl er(this painthandler); // This is the
equivalent of AddHandler
Using my code, what is the .Paint part? Would that be InternetExplore r?
I'm not quite sure how to build the following in C#:
[VB.NET]
Private WithEvents IE_Inst As New SHDocVw.Interne tExplorer
Maps to things such as:
Public Sub IEDocComplete(B yVal pDisp As Object, ByRef URL As Object)
Handles
IE_Inst.Documen tComplete
Brett