H
Hyper X
Hi,
How do I cancel the event out if the sender is a textbox, combobox,
checkbox etc in form level event like Form1_KeyPress??
private void Form1_KeyPress(object sender, KeyEventArgs e)
{
///
/// Figure out if the event is from Form1... and NOT from the
textbox...
/// Cancel the event out if the sender is anyone other than form or
tab.
///
}
I tried sender.GetType() and it always comes up as
"MyNamespace.WinUI.Form1" even though I pressed the key from the
TextBox.
How can I know if the sender is a textbox from the Form1_KeyPress??
Since textbox is on the form, form level event gets executed, which is
fine (or may not be fine?? since this should be handled in
TextBox_KeyPress event.)
Any help from any one is greatly appreciated.
Thanks,
HyperX.
-------> The next statement is true. The previous statement is false.
<--------
How do I cancel the event out if the sender is a textbox, combobox,
checkbox etc in form level event like Form1_KeyPress??
private void Form1_KeyPress(object sender, KeyEventArgs e)
{
///
/// Figure out if the event is from Form1... and NOT from the
textbox...
/// Cancel the event out if the sender is anyone other than form or
tab.
///
}
I tried sender.GetType() and it always comes up as
"MyNamespace.WinUI.Form1" even though I pressed the key from the
TextBox.
How can I know if the sender is a textbox from the Form1_KeyPress??
Since textbox is on the form, form level event gets executed, which is
fine (or may not be fine?? since this should be handled in
TextBox_KeyPress event.)
Any help from any one is greatly appreciated.
Thanks,
HyperX.
-------> The next statement is true. The previous statement is false.
<--------