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.

CANCEL The Cancel property provides a means of responding when the user presses the<br />

Esc key. At most one comm<strong>and</strong> button on a form may have its Cancel property set to True.<br />

If the Esc key is pressed while the program is running, <strong>Visual</strong> <strong>Basic</strong> will execute the click<br />

event procedure of the comm<strong>and</strong> button whose Cancel property is True.<br />

CAPTION The Caption property holds the text that is to appear as the caption for a form,<br />

comm<strong>and</strong> button, data control, or label. If an ampers<strong>and</strong> (&) is placed in the caption of a<br />

comm<strong>and</strong> button or label, the ampers<strong>and</strong> will not be displayed, but the character following<br />

the ampers<strong>and</strong> will become an underlined access key. Access keys provide a quick way to<br />

access a comm<strong>and</strong> button or the control (usually a text box) following (in tab index order) a<br />

label. Access keys are activated by holding down the Alt key <strong>and</strong> pressing the access key<br />

character.<br />

CBOOL The function CBool converts byte, currency, double-integer, integer, long integer,<br />

<strong>and</strong> single-precision numbers to the Boolean values True or False. Nonzero values are converted<br />

to True <strong>and</strong> zero is converted to False. If x is any number, then the value of CBool(x)<br />

is the Boolean value determined by x.<br />

CBYTE The function CByte converts integer, long integer, single-precision, double-precision,<br />

<strong>and</strong> currency numbers to byte numbers. If x is any number, then the value of CByte(x)<br />

is the byte number determined by x.<br />

CCUR The function CCur converts byte integer, long integer, single-precision, <strong>and</strong> doubleprecision<br />

numbers to currency numbers. If x is any number, then the value of CCur(x) is the<br />

currency number determined by x.<br />

CDATE The function CDate converts byte, currency, double-integer, integer, long integer,<br />

<strong>and</strong> single-precision numbers to dates. If x is any number, then the value of CDate(x) is the<br />

date determined by x.<br />

CDBL The function CDbl converts byte, integer, long integer, single-precision, <strong>and</strong> currency<br />

numbers to double-precision numbers. If x is any number, then the value of CDbl(x) is the<br />

double-precision number determined by x.<br />

CHANGE The Change event occurs when the contents of a combo box, directory list box,<br />

drive list box, label, picture box, scroll bar, or text box are altered in a specific way. The alterations<br />

are: (a) change of text (combo box or text box), (b) user selects a new directory or<br />

drive (directory <strong>and</strong> drive list boxes), (c) thumb moves (scroll bar), (d) change of Caption<br />

property (label), <strong>and</strong> (e) change of Picture property (picture box).<br />

CHDIR The statement ChDir path changes the current directory on the specified disk drive<br />

to the subdirectory specified by path. For example, ChDir “C:\”specifies the root directory<br />

of the C drive as the current directory. Omitting a drive letter in path causes the default drive<br />

to be used. [directories]<br />

CHDRIVE The statement ChDrive drive changes the default drive to the drive specified by<br />

drive. For example, ChDrive “A”specifies the A drive as the new default drive.<br />

CHR If n is a number from 0 to 255, then a statement of the form objectName.Print Chr(n)<br />

displays the nth character of the current font.<br />

CINT The function CInt converts byte, long integer, single-precision, double-precision, <strong>and</strong><br />

currency numbers to integer numbers. If x is any number from –32768 to 32767, the value<br />

of CInt(x) is the (possibly rounded) integer constant that x determines.<br />

CIRCLE The graphics method objectName.Circle (x, y), r, c, r1, r2, a draws on objectName<br />

a portion, or all, of an ellipse. The center of the ellipse is the point (x, y) <strong>and</strong> the longer radius<br />

is r. The color of the ellipse is determined by c. If r1 <strong>and</strong> r2 are present, then the computer<br />

draws only the portion of the ellipse that extends from the radius line at an angle of Abs(r1)<br />

radians with the horizontal radius line to the radius line at an angle of Abs(r2) radians with<br />

the horizontal radius line in a counterclockwise direction. If either r1 or r2 is negative, the<br />

Appendix C 425

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

Saved successfully!

Ooh no, something went wrong!