adding events for a control?

dynamic_sysop

Senior Contributor
Joined
Oct 1, 2002
Messages
1,039
Location
Ashby, Leicestershire.
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...
Visual Basic:
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.
Visual Basic:
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.

:)
 
that one's ok , i think this will work as it dont error now...
Visual Basic:
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.
 
Back
Top