By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,464 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,464 IT Pros & Developers. It's quick & easy.

Delegation question ?

P: n/a
Hi
I have a form, it has a button and a control I made.
The control has its own functions.
I want to delegate a keystroke on the control to a button in the main form.
Meaning, a function in the control will trigger a function in the form.
it's not a static function, and the form is not a singleton. is there a way
to it ?
10x.
Apr 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
VJ
you are on the right path... use delegates to inform the Parent control, i.e
in your case the Form , and in that execute your Form code..., so
delegates/events is the way to go. There is no singleton or static functions
here..

VJ

"Nadav" <na****@gmail.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi
I have a form, it has a button and a control I made.
The control has its own functions.
I want to delegate a keystroke on the control to a button in the main
form.
Meaning, a function in the control will trigger a function in the form.
it's not a static function, and the form is not a singleton. is there a
way
to it ?
10x.

Apr 4 '06 #2

P: n/a
Nadav,

Have you looked at the KeyPreview property on the Form class? Setting
this will allow the form to process key strokes before the events are passed
to the control/window on the form that it is intended for.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nadav" <na****@gmail.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi
I have a form, it has a button and a control I made.
The control has its own functions.
I want to delegate a keystroke on the control to a button in the main
form.
Meaning, a function in the control will trigger a function in the form.
it's not a static function, and the form is not a singleton. is there a
way
to it ?
10x.

Apr 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.