Presenting YesNo Options Using Check Boxes


Presenting Yes/No Options Using Check Boxes

A check box is used to display True/False and Yes/No values on a form, and you've probably run into many of them as you've worked with different Windows applications. Clicking the check box control toggles it between checked and unchecked (True/false, yes/no, and so on).

Add a new check box to the Options form now and set its properties as follows:

Property

Value

Name

chkPromptOnExit

Location

105,79

Text

Prompt to confirm on exit


The CheckState property of the check box determines whether the check box is checked. Try changing the value of this property and watch the effect on the form. Notice that you can set the check box's CheckState to Indeterminate, which shows a big square in the control. You won't often need to use this, but it's good to know the feature is available. Be sure to set the CheckState to Unchecked before continuing.

Your form should now look like Figure 7.8.

Figure 7.8. Use the check box to indicate a True/false or yes/no state.





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