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

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

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

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

lines. If the text box is not tall enough, lines will scroll up out of view, but can<br />

be redisplayed by moving the cursor up.)<br />

H. Assign an access key to a label or comm<strong>and</strong> button.<br />

1. When assigning a value to the Caption property, precede the desired access key<br />

character with an ampers<strong>and</strong> (&).<br />

I. Allow a particular comm<strong>and</strong> button to be activated by a press of the Enter key.<br />

1. Set the comm<strong>and</strong> button’s Default property to True.<br />

Note: Setting the Default property True for one comm<strong>and</strong> button automatically sets<br />

the property to False for all the other comm<strong>and</strong> buttons on the form.<br />

J. Adjust the order in which the Tab key moves the focus.<br />

1. Select the first control in the tabbing sequence.<br />

2. Change the setting of the TabIndex property for this control to 0.<br />

3. Select the next control in the tabbing sequence.<br />

4. Change the setting of the TabIndex property for this control to 1.<br />

5. Repeat Steps 3 <strong>and</strong> 4 (adding 1 to the Tab Index property) until all controls on<br />

the form have been assigned a new TabIndex setting.<br />

Note: In Steps 2 <strong>and</strong> 4, if an object is moved to another position in the sequence,<br />

then the TabIndex property for the other objects will be renumbered accordingly.<br />

K. Allow the pressing of Esc to activate a particular comm<strong>and</strong> button.<br />

1. Set the comm<strong>and</strong> button’s Cancel property to True. (Setting the Cancel property<br />

to True for one comm<strong>and</strong> button automatically sets it to False for all other<br />

comm<strong>and</strong> buttons.)<br />

L. Keep the contents of a picture box from being erased accidentally.<br />

1. Set the picture box’s AutoRedraw property to True. (The default is False. Unless<br />

the property is set to True, the contents will be erased when the picture box is<br />

obscured by another window.)<br />

HOW TO: MANAGE PROCEDURES<br />

A. Access the Code window.<br />

1. Press Alt/V/C or F7. (If the Code window does not appear, run <strong>and</strong> then terminate<br />

the program.)<br />

or<br />

1. Press Alt/V/P to activate the Project Explorer window.<br />

2. Select the name of the form.<br />

3. Click on the “View Code”button.<br />

B. Look at an existing procedure.<br />

1. Access the Code window.<br />

2. Press Ctrl+Down Arrow or Ctrl+Up Arrow to see all the procedures.<br />

or<br />

1. Access the Code window.<br />

2. Click on the down arrow at the right of the Object box <strong>and</strong> then select an object.<br />

[For general procedures select (General) as the Object.]

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

Saved successfully!

Ooh no, something went wrong!