ultraman Posted July 15, 2004 Posted July 15, 2004 I must have missed something, but it seems to me that it's quite painful to add an event handler in C#. I tried this this.Closing += new System.EventHandler(this.frmMain_Closing); in the InitializeComponent() method. My handler looks like this : private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e) But I always get an error. It must be the param types, but I don't know how to set it right. I'm working with Framework 1.0 (VS 2002) Can anyone help me please ? Quote Now go on, boy, and pay attention. Because if you do, someday, you may achieve something that we Simpsons have dreamed about for generations: You may outsmart someone! --Homer Simpson
Administrators PlausiblyDamp Posted July 15, 2004 Administrators Posted July 15, 2004 this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing); is probably what you are looking for - you were right though it was just a matter of getting the correct arguments. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ultraman Posted July 15, 2004 Author Posted July 15, 2004 Thanks ! That was just what I needed. Quote Now go on, boy, and pay attention. Because if you do, someday, you may achieve something that we Simpsons have dreamed about for generations: You may outsmart someone! --Homer Simpson
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.