Leaders dynamic_sysop Posted June 1, 2003 Leaders Posted June 1, 2003 hi i've decided it's time to dabble in C# :-\ i'm just working on adding some events to a form with a textbox and a webbrowser. so far i managed to figure out how to add this event... this.textBox1.Click += new System.EventHandler(this.textBox1_Click); // at the design area private void textBox1_Click(object sender, System.EventArgs e) { MessageBox.Show(Application.ProductName,"test"); } but i'm trying to add an event for Document complete on the browser and it wont allow it. this.wb.DocumentComplete += new System.EventHandler(this.wb_DocumentComplete); /// gets highlighted as not correct ^^^ private void wb_DocumentComplete(object sender,System.EventArgs e) { // } any advice on this would be appreciated ty. :) Quote
Leaders dynamic_sysop Posted June 1, 2003 Author Leaders Posted June 1, 2003 that one's ok , i think this will work as it dont error now... this.wb.DocumentComplete += new AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(this.wb_DocumentComplete); // private void wb_DocumentComplete(object sender,AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e) { // } but any advice on when to use System.EventArgs and when to use events that are specific to the item would be appreciated ty. Quote
*Gurus* divil Posted June 1, 2003 *Gurus* Posted June 1, 2003 The documentation (or the object browser) will tell you the delegate type for an event. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.