120 likes | 330 Views
Visual Basic Project 2. IDS 306 Spring 1999 V. Murphy. List boxes and Combo boxes. see table 2-1 page 2.13 for types Type set with Style property List property AddItem method ListIndex. Text Boxes. Locked property when true user cannot change its contents MultiLine property
E N D
Visual Basic Project 2 IDS 306 Spring 1999 V. Murphy
List boxes and Combo boxes • see table 2-1 page 2.13 for types • Type set with Style property • List property • AddItem method • ListIndex
Text Boxes • Locked property • when true user cannot change its contents • MultiLine property • ScrollBars property • horizontal or vertical • Note: there is no caption property for a text box
Frames and other controls • Frame • Option Button • why use a non-visible button • Shapes • borders • visual enhancements • Check boxes
Variables • Data type--determines kind of data variable can store • Naming rules • must begin with a letter • cannot be more than 255 characters • cannot contain punctuation or blank spaces
Declaring Variables • Implicitly declared--created by using them • rate = 3.5 • Explicitly declared--in a separate code statement • Dim variablename As datatype • scope • static
Arithmetic Operators see table 2-7 page 2.45
Comparison Operators see table 2-8 page 2.46
Predefined Formats • General Number--displays as is • Currency--dollar sign, thousand separator, 2 digits to right, negatives in parentheses • Fixed--2 digits to right, at least 1 to left • Standard--thousands separator, (2 to right) • Percent--multiplied by 100, % • Yes/No--No if number is 0, else Yes
Strings • Format$ statement • $ instructs VB to change numeric result to a string • strings • character data • placed within quotation marks • null string--““ • concatenation--adding strings together
Control Code Characters • chr$(13)--return insertion point to beginning of line • chr$(10)--move insertion point down one line • constants • vbNewLine = chr$(10) & chr$(13) • False = 0 • True = -1
VB Naming Conventions See Table 2-2 page 2.28