19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

30 <strong>Computer</strong> <strong>Programming</strong> <strong>Concepts</strong> <strong>and</strong> <strong>Visual</strong> <strong>Basic</strong><br />

5. Type the line<br />

txtPhrase.Font.Size = 12<br />

between the existing two lines. (We usually indent lines inside procedures.)<br />

(After you type each period, the editor displays a list containing possible choices<br />

of items to follow the period. See Figure 2-16. This feature is called “List<br />

Properties/Methods.” In Figure 2-16, instead of typing the word “Size,” you can<br />

double-click on “Size” in the displayed list or highlight the word “Size” <strong>and</strong><br />

press Tab.) The screen appears as in Figure 2-17. We have now created an event<br />

procedure that is activated whenever the text box loses the focus.<br />

FIGURE 2-16 A LostFocus Event Procedure<br />

FIGURE 2-17 A LostFocus Event Procedure<br />

6. Let’s create another event procedure for the text box. Click on the down-arrow<br />

button to the right of the Procedure box, scroll up the list of event procedures,<br />

<strong>and</strong> click on GotFocus. Then type the lines<br />

txtPhrase.Font.Size = 8txtPhrase.Font.Bold = False<br />

between the existing two lines. See Figure 2-18.

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

Saved successfully!

Ooh no, something went wrong!