adding events for a control?

dynamic_sysop

Well-known member
Joined
Oct 1, 2002
Messages
1,039
Location
Ashby, Leicestershire.
hi ive decided its time to dabble in C# :-\ im 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...
Code:
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 im trying to add an event for Document complete on the browser and it wont allow it.
Code:
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 ones ok , i think this will work as it dont error now...
Code:
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.
 
The documentation (or the object browser) will tell you the delegate type for an event.
 

Similar threads

R
Replies
0
Views
117
Raymond Gilbers
R
M
Replies
0
Views
117
Matt Armshaw
M
R
Replies
0
Views
67
Rechtfertigung
R
A
Replies
0
Views
141
Afshan Gul
A
Back
Top