ThienZ Posted May 25, 2005 Posted May 25, 2005 Hi, is it possible to remove or turn an event off (and then on) from a control? I add an event like this : this.KeyPress += new KeyPressEventHandler(TextBoxMaxNr_KeyPress); How can i turn it on/off ? Thx in advance Quote
stustarz Posted May 25, 2005 Posted May 25, 2005 Without having the IDE in front of me im sure the syntax is something like : this.KeyPress -= KeyPressEventHandler; Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
Leaders snarfblam Posted May 25, 2005 Leaders Posted May 25, 2005 I think you do it like this: this.KeyPress -= new KeyPressEventHandler(TextBoxMaxNr_KeyPress); Create the new delegate, and use the -= operator to have that function removed from the list of handlers. Quote [sIGPIC]e[/sIGPIC]
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.