30.07.2013 Views

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

520 Graphical User Interface Concepts: Part 1 Chapter 12<br />

visual programming Windows Form<br />

widget Xor<br />

window gadget<br />

SELF-REVIEW EXERCISES<br />

12.1 State whether each of the following is true or false. If false, explain why.<br />

a) The KeyData property includes data about modifier keys.<br />

b) Windows Forms commonly are used <strong>to</strong> create GUIs.<br />

c) A form is an example of a container.<br />

d) All forms, components and controls are classes.<br />

e) Events are based on properties.<br />

f) A Label displays text that the user can edit.<br />

g) But<strong>to</strong>n presses generate events.<br />

h) Checkboxes in the same group are mutually exclusive.<br />

i) All mouse events use the same event arguments class.<br />

j) <strong>Visual</strong> Studio can register an event and create an empty event handler.<br />

12.1 Fill in the blanks in each of the following statements:<br />

a) The active control is said <strong>to</strong> have the .<br />

b) The form acts as a for the controls that are added.<br />

c) GUIs are driven.<br />

d) Every method that handles the same event must have the same .<br />

e) The information required when registering an event handler is the class and<br />

the .<br />

f) A(n) textbox masks user input with another character.<br />

g) Class and class help arrange controls on a GUI and provide logical<br />

groups for radio but<strong>to</strong>ns.<br />

h) Typical mouse events include , and .<br />

i) events are generated when a key on the keyboard is pressed or released.<br />

j) The modifier keys are , and .<br />

k) A(n) event or delegate can call multiple methods.<br />

ANSWERS TO SELF-REVIEW EXERCISES<br />

12.1 a) True. b) True. c) False. A control is a visible component. d) True. e) False. Events are<br />

based on delegates. f) False. A Label‘s text cannot be edited by the user. g) True. h) False. Radio<br />

but<strong>to</strong>ns in the same group are mutually exclusive. i) False. Some mouse events use EventArgs, others<br />

MouseEventArgs. j) True.<br />

12.2 a) focus. b) container. c) event. d) signature. e) event arguments, delegate. f) password.<br />

g) GroupBox, Panel. h) mouse clicks, mouse presses, mouse moves. i) Key. j) Shift, Control, Alt.<br />

k) multicast.<br />

EXERCISES<br />

12.2 Extend the program in Fig. 12.24 <strong>to</strong> include a CheckBox for every font style option. [Hint:<br />

Use Xor rather than testing for every bit explicitly.]<br />

12.3 Create the following GUI:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!