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.

Object<br />

box<br />

1. Create the interface in Figure 2-13. The Name properties of the form, text box,<br />

<strong>and</strong> comm<strong>and</strong> button should be set as shown in the Object column. The Caption<br />

property of the form should be set to Demonstration, the Text property of the<br />

text box should be made blank, <strong>and</strong> the Caption property of the comm<strong>and</strong> button<br />

should be set to Make Phrase Bold.<br />

2. Double-click on the text box. A window, called the Code window, appears. See<br />

Figure 2-14. Just below the title bar are two drop-down list boxes. The left box<br />

is called the Object box <strong>and</strong> the right box is called the Procedure box. (When<br />

you position the mouse pointer over one of these list boxes, its type appears.)<br />

FIGURE 2-14 A Code Window<br />

3. Click on the down-arrow button to the right of the Procedure box. The dropdown<br />

menu that appears contains a list of all possible event procedures associated<br />

with text boxes. See Figure 2-15.<br />

FIGURE 2-15 Drop-Down Menu of Event Procedures<br />

4. Scroll down the list of event procedures <strong>and</strong> click on LostFocus. (LostFocus is<br />

the 14th event procedure.) The lines<br />

Private Sub txtPhrase_LostFocus()<br />

Procedure<br />

box<br />

End Sub<br />

appear in the code window with a blinking cursor poised at the beginning of the<br />

blank line.<br />

<strong>Visual</strong> <strong>Basic</strong> Events 29

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

Saved successfully!

Ooh no, something went wrong!