Chapter 3- Data Types and Operators Boolean Expressions Page 2 3 4

Introduction

The If Statement Page 2 3 4 5 6 7 8 9
Arithmetic Operations Page 2 3 4 5 6 Boolean Operators and Nested If Statements Page 2 3 4 5 6 7
Events and Sequential Processing Page 2 3 4 5 More Examples Page 2 3 4 5 6 7 8 9 10 11 12
Datatypes and Conversions Page 2 3 4 5 6 7 Using Check Box and Option Controls Page 2 3 4 5 6 7 8 9 10
Variable Declarations - Local and Global Page 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Exercises Page 2 3 4 5 6 7 8
Chapter 4- Selection Statements Review Questions
Introduction

4-7: Check Box and Option Controls

Introduction

Check box and option controls (also called radio buttons; in fact we'll use the names interchangeably) often accompany If statements since their very nature involves selection. In the case of check boxes either selecting or deselecting something, and in the case of option controls selecting from among a number of options.

The radio button control typically involves a choice of one option among many and they are often grouped within a GroupBox control. That too is introduced in the exercises developed in this section. Often it is possible to avoid implementing events for each radio button control within a group, instead writing a single event that responds no matter which one of the objects in the group the user interacts with. Thus a click on any object in the group - no matter which one - initiates the same Click event, for example.

However, often a slightly different task must be done depending on which element of the group has been selected. Thus when writing the program code for an event - the Click event, for example - you often need to know which individual element of the group has been selected. That information is communicated via one of the arguments (or parameters). We have certainly provided parameters when calling a function but we have avoided the parameter list that you see when writing the code for an event. We will further explore parameters at length in a later chapter, independently from events.