QA


Q&A

Q.

Is it possible to capture keystrokes at the form level, rather than capturing them in control events?

A.

Yes. For the form's keyboard-related events to fire when a control has the focus, however, you must set the form's KeyPreview property to true. The control's keyboard events will still fire, unless you set KeyPressEventArgs.Handled to true in the control's KeyPress event.

Q.

You don't seem to always specify a button in your MessageBox.Show() statements throughout this book. Why?

A.

If you don't explicitly designate a button or buttons, Visual C# displays the OK button. Therefore, if all you want is an OK button, you don't need to pass a value to the Buttons argument.




Sams Teach Yourself Microsoft Visual C# 2005 in 24 Hours, Complete Starter Kit
Sams Teach Yourself Visual C# 2005 in 24 Hours, Complete Starter Kit
ISBN: 0672327406
EAN: 2147483647
Year: N/A
Pages: 248
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net