Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: IntPtr and Strings Pin
Heath Stewart4-Feb-04 10:29
protectorHeath Stewart4-Feb-04 10:29 
GeneralRe: IntPtr and Strings Pin
Tristan Rhodes4-Feb-04 10:38
Tristan Rhodes4-Feb-04 10:38 
GeneralRe: IntPtr and Strings Pin
Heath Stewart4-Feb-04 10:44
protectorHeath Stewart4-Feb-04 10:44 
GeneralRe: IntPtr and Strings Pin
Tristan Rhodes4-Feb-04 10:46
Tristan Rhodes4-Feb-04 10:46 
QuestionRemoving an EventHandler??? Pin
LongRange.Shooter4-Feb-04 9:21
LongRange.Shooter4-Feb-04 9:21 
AnswerRe: Removing an EventHandler??? Pin
Heath Stewart4-Feb-04 10:27
protectorHeath Stewart4-Feb-04 10:27 
GeneralRe: Removing an EventHandler??? Pin
LongRange.Shooter5-Feb-04 2:22
LongRange.Shooter5-Feb-04 2:22 
GeneralRe: Removing an EventHandler??? Pin
Heath Stewart5-Feb-04 4:18
protectorHeath Stewart5-Feb-04 4:18 
It is only a new delegate but the delegate references the same method (of the same instance), so it will get removed. You can keep a reference to your delegate you added initially if you don't believe me, but trust that it works this way.

As far as who removes event handler is up to your design. If the child form is hooking into its parent form, then the child should remove the event handler for a better OO design. You could do this in the Closing or Closed event if you like, but know that the event handler will be nullified and garbaged collected if the child reference gets destroyed. It really isn't necessary in such a case.

 

Microsoft MVP, Visual C#
My Articles
GeneralFileInfo.ValidateFIleName Pin
elena123454-Feb-04 8:07
elena123454-Feb-04 8:07 
GeneralRe: FileInfo.ValidateFIleName Pin
Not Active4-Feb-04 8:38
mentorNot Active4-Feb-04 8:38 
GeneralRe: FileInfo.ValidateFIleName Pin
John Kuhn4-Feb-04 8:48
John Kuhn4-Feb-04 8:48 
GeneralXML Web Services question Pin
Chen Venkataraman4-Feb-04 7:23
Chen Venkataraman4-Feb-04 7:23 
GeneralRe: XML Web Services question Pin
Andy Brummer4-Feb-04 8:56
sitebuilderAndy Brummer4-Feb-04 8:56 
GeneralRe: XML Web Services question Pin
Heath Stewart4-Feb-04 8:59
protectorHeath Stewart4-Feb-04 8:59 
GeneralRe: XML Web Services question Pin
Michael Potter4-Feb-04 9:15
Michael Potter4-Feb-04 9:15 
GeneralTab control question Pin
Shizam4-Feb-04 5:47
Shizam4-Feb-04 5:47 
GeneralRe: Tab control question Pin
Heath Stewart4-Feb-04 6:04
protectorHeath Stewart4-Feb-04 6:04 
GeneralRe: Tab control question Pin
Shizam4-Feb-04 8:00
Shizam4-Feb-04 8:00 
GeneralRe: Tab control question Pin
Alex Korchemniy4-Feb-04 8:02
Alex Korchemniy4-Feb-04 8:02 
GeneralRe: Tab control question Pin
Heath Stewart4-Feb-04 8:44
protectorHeath Stewart4-Feb-04 8:44 
GeneralRe: CrystalReportViewer Pin
Alex Korchemniy4-Feb-04 9:53
Alex Korchemniy4-Feb-04 9:53 
GeneralVS problem Pin
Judah Gabriel Himango4-Feb-04 5:26
sponsorJudah Gabriel Himango4-Feb-04 5:26 
GeneralRe: VS problem Pin
Heath Stewart4-Feb-04 5:35
protectorHeath Stewart4-Feb-04 5:35 
GeneralRe: VS problem Pin
Judah Gabriel Himango4-Feb-04 5:48
sponsorJudah Gabriel Himango4-Feb-04 5:48 
GeneralRe: VS problem Pin
Heath Stewart4-Feb-04 5:53
protectorHeath Stewart4-Feb-04 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.