|
-
May 7th, 2009, 11:03 AM
#1
[RESOLVED] Having a hard time unserstanding this.
Hi all,
I have spent some time reading about events and delegates and being new to this concept, I find it difficult to understand. I would like to call the keypress event of a textbox from another object, say a button, using this concept. I would really appreciate if an expert walks me through the process of achieving this.
I know that I need to create a delegate and an event as follows.
public delegate void KeyHandler(object source, KeyEventArgs e);
public event KeyHandler KeyPress;
That you subscribe to it using the += and unsubscribe using the -+, but how to connect them together and link them to the textbox keypress event.
Your help would be greatly appreciated.
Thanks.
Last edited by admdev; May 7th, 2009 at 11:37 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|