T
~toki
How can i take the control of the key events in Class2 ?
This is the code snipped that i'd tried (after try some others):
public class Main : System.Windows.Forms.Form
{
protected virtual void OnKeyPress(System.Object sender,
System.Windows.Forms.KeyPressEventArgs e) { /* Do Nothing */ }
}
public class Class1 : Main
{
protected override void OnKeyPress(System.Object sender,
System.Windows.Forms.KeyPressEventArgs e) { /* Do Nothing */ }
}
public class Class2 : Class1
{
protected override void OnKeyPress(System.Object sender,
System.Windows.Forms.KeyPressEventArgs e) { /* DO SOMETHING */ }
}
This is the code snipped that i'd tried (after try some others):
public class Main : System.Windows.Forms.Form
{
protected virtual void OnKeyPress(System.Object sender,
System.Windows.Forms.KeyPressEventArgs e) { /* Do Nothing */ }
}
public class Class1 : Main
{
protected override void OnKeyPress(System.Object sender,
System.Windows.Forms.KeyPressEventArgs e) { /* Do Nothing */ }
}
public class Class2 : Class1
{
protected override void OnKeyPress(System.Object sender,
System.Windows.Forms.KeyPressEventArgs e) { /* DO SOMETHING */ }
}