OK Try again
Can someone please explain what the difference is and when to use each.
I have a form with a button dropped onto it. Without actually doing anything
to the button, I next add the following code to the form:
protected override void OnKeyDown(KeyEventArgs e)
{
System.Diagnostics.Debug.WriteLine(e.KeyCode.ToStr ing());
base.OnKeyDown(e);
}
When you press a key, it is not handled. If you change the tabstop property
of the button to false, the key down event is now handled. Why?
However, if I put the tabstop property of the button back to true and I add
an keydown event instead:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
System.Diagnostics.Debug.WriteLine(e.KeyCode.ToStr ing());
}
When you press a key it is handled. What is happening that is different?
My understanding of what happens when you override a form method seems to be
shot to pieces.
So when should you override form methods and when should you use events?
Any clarification on this subject area would be most appreciated.
Thanks
Mike