I'm getting this error now on the line below:
C:\myFiles\myprogC#\Main\IE.cs(31): Method 'Mail.IE.IEDocComplete(object,
ref object)' does not match delegate 'void System.EventHandler(object,
System.EventArgs)'
[for this code]
IE_Inst.DocumentComplete += new System.EventHandler(IEDocComplete);
[method defined here]
public void IEDocComplete(object pDisp, ref object url)
{
What exactly is it asking for?
Thanks,
Brett
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:ui**************@TK2MSFTNGP12.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.AxWebBrowser axWebBrowser1 = new AxSHDocVw.AxWebBrowser();
this.axWebBrowser1.DocumentComplete += new
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent Handler(this.axWebBrowser1_DocumentComplete);
--
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**************@TK2MSFTNGP09.phx.gbl...
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%2****************@TK2MSFTNGP09.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 PaintEventHandler(this painthandler); // This is the
equivalent of AddHandler
Using my code, what is the .Paint part? Would that be InternetExplorer?
I'm not quite sure how to build the following in C#:
[VB.NET]
Private WithEvents IE_Inst As New SHDocVw.InternetExplorer
Maps to things such as:
Public Sub IEDocComplete(ByVal pDisp As Object, ByRef URL As Object)
Handles
IE_Inst.DocumentComplete
Brett