| Lesson 1 1. Microsoft
Visual Basic.NET is a software development tool that allows you to
create Windows programs. VB.net is a part of Visual Studio.Net
2. VB.NET project is made up of several files.
a. VBPROJ extension - holds data about a project.
b. SLN extension - information about a solution is stored in this
file.
c. The solution explorer allows you to see and open the forms and
other files that make up a project.
3. The properties window lets you view the characteristics, or
properties of the objects and make changes to those properties.
4. The toolbox holds the tools that allow you to add objects to a form.
5. To run a program click the start button on the Standard toolbar.
6. The integrated Development Environment
Lesson 2
1. The Windows application project type allows you to create a
program from scratch.
2. All windows applications begin with a blank form and must have at
least one form that becomes the window when the program is run.
3. All other objects are contained within the form(s).
4. By default a window created in VB.Net can be moved, resized,
maximized minimized, and closed.
5. Properties are the characteristics of an object and can be changed in
the properties window.
a. The text property controls what the user sees in the title bar of
a form and in other objects.
b. The Name property allows up to refer to objects using a
meaningful name in programming code.
6. Controls are the objects that make up the user interface.
7. A button is a standard pushbutton control the commonly appears in
dialog boxes. They can be moved, resize and deleted like other objects.
8. Focus refers to the active status of an object in the window. Only
one object can have the focus at a time. Focus is controlled by the tab
order.
9. BackColor property controls the background color of a form.
10. Location property can be used to accurately position objects by
Pixels.
Lesson 3
1. Windows is an event/action-driven environment which requires the
user to take an action to control the work being done.
2. Event procedures must be written for event you wish to handle, click,
or double click, or right click.
3. To access the code window double click the object. (an event)
4. VB.NET code is written in sections called sub routines.
5. VB.NET has intelliSense feature to help format our program code. It
offers what must follow the original code.
6. The end statement ends a program.
7. PictureBox tool allows you to add a picturebox control to a form. Use
the name property.
8. The SizeMode property set to StretchImage cause a picture to resize
to fit the dimensions of the Picture Box control. AutoSize cause a
PictureBox control to resize to fit the picture.
9. Visible set to False will hide object. Visible set to True will
display object.
10. VB.NET code is often used for setting properties of an object which
allows the change of properties while the program is running.
11. To change properties to from code you send a message to the object
which uses a method to change the property.
12. A button with a & in front of a letter in the Text property cause
that letter to become an access key. A button named in the form's
AcceptButton property will be activated when he user presses the enter
key. The CancelButton property will be activated by the Esc key.
Lesson 4
1. Operators perform specific operations.
a. + add values
b. - subtracts the value to the right of the operator from the value
to the left of the operator. Also can be used to perform unary negation.
c. = assigns the result of the expression on the right of the
operator tot he item to the left of the operator.
d. * (asterisk) is used to multiply 5*2=10
e. / (forward slash) is used for division 5/2=2.5
f. \ (black slash) is used for integer division 5/2=2
g. mod is used for module division which returns the remainder 5 mod
2 = 1
2. Values keyed directly into code are called hard-coded values or
literals (constants)
3. Text boxes allow the user to enter a value.
4. The VAL() functions is used to convert text numbers in a text box to
numeric values.
5. The _ (underscore) is called the line-continuation character.
6. An ' (apostrophe) is used for a comment line that is not executable.
7. The FIX() functions removes the fractional portion of a number by
truncating.
Mathematical Order of precedence for evaluating expressions/formulas.
| Mathematical Operator |
Use |
| ^ - exponential |
3^3 = 27 |
| * - multiply |
3*3 = 9 |
| / - divide |
5/2=2.5 |
| \ - integer division |
5\2 = 2 |
| mod - modular division |
5 mod 2 = 1 |
| + - add |
5 +2 = 7 |
| - - subtract |
5 - 2=3 |
| ( ) parenthesis |
do what is inside first |
Lesson 5
1. The exponential operator (^) raises a number to a power.
2. The rules that dictate the order that math operators are applied in a
formula are called the order of operations.
3. Parentheses can be used to override the order of operations.
4. The Visible property can be used to hide a label until you are ready
for the user to see it.
5. The apostrophe is used to add comments to VB.NET code. Internal
Documentation.
6. Run-time errors (exceptions) occur while the program is running.
7. Try/Catch/EndTry is used for error trapping.
8. Exit Sub is used to exit an error.
9. MsgBox function pops up a dialog box, delivering a message to the
user.
10. When a error can not be completely handled, send message to user and
use exit sub to end the event procedure before the error can cause
additional problems.
Lesson 6
1. Data can be in the form of numbers, text, dates, pictures, and even
sound.
2. VB.NET supports a set of data types. Whole numbers, floating-point
numbers (decimals), text, dates, and more.
| Data Type |
Range |
| Byte |
0 - 255 |
| Short |
-32,768 to 32,767 |
| Integer |
-2,147,483,648 to 2,147,483,647 |
| Long |
-9,223,372,036,854,775,808 to
9,223,372,036,854,775,807 |
| Decimal Types |
|
| Single |
-3.402823E+38 to 3.402823E+38 |
| Double |
-1.79769313486232E+308 to 1.79769313486232E+308 |
| Decimal |
-922,337,203,685,477.5808 to
922,337,203,685,477.5807 |
| Other Types |
|
| String |
1 to 65,000 characters |
| Date |
Jan 1,0001 to dec 31, 9999 |
| Boolean |
True or False |
| Object |
Varies |
| |
|
3. Data stored in memory locations are called variables.
4. AutoSize property will adjust the size of a control to fit its
contents.
5. The Dim statement is used to declare variables.
6. Variable names
a. Must begin with a letter.
b. After the first character letters, numbers and Underscore(_)
are allowed.
c. No spaces in name
d. <=255 characters in name
e. Variable name prefixes.
| Prefix |
Data Type |
Example |
| byt |
Byte |
bytCount |
| srt |
Short |
srtIndex |
| int |
Integer |
IntPeople |
| lng |
Long |
lngInches |
| sng |
Single |
sngWeight |
| dbl |
Double |
dblMass |
| dec |
Decimal |
decSalary |
| str |
String |
strName |
| dte |
Date |
dteAnniversary |
| bin |
Bollean |
binSold |
| obj |
Object |
objValue |
7. Scope indicates what procedures have access to a variable. Local,
Form-level, or global.
a. Local is declared within an event procedure.
b. Form-level is declared in the declarations section of a forms
code window.
c. Global is declared in a code modules declarations sections.
d. general rule is to declare variables locally.
8. Declarations section of a form's code window allows you to declare
form-level variables.
9. Object data type can hold may different kinds of data, but is less
efficient than specific data types.
Lesson 7
1. Strings hold text or alphanumeric data
2. String is a data type
3. Text in a string variable must be placed in quote marks
4. The assignment operator (=) can be used to assign text fro a text box
to a string variable or from a string variable to another string
variable.
5. Concatenation is the process of appending one string to the end of
another using the &.
6. Single, double, and Decimal data types hold decimal data.
a. decimal data type is specifically designed for handling dollars
and cents to 4 decimal places.
7. Format() function can be used to format decimal values, phone
numbers, and more.
| Symbol |
Description |
| 0 |
Cause a digit to appear in the space, if the
data has no value a 0 appears |
| # |
Cause a digit to appear in the space, in the
data has no value nothing appears |
| . |
Used to specify where you want the decimal
point to appear in the format |
| , |
commas will appear in the output |
| % |
Causes a number to be multiplied by 100 and a %
sign at the end of the number |
8. The Enabled property is used to make a control inactive or active.
9. The SelectionStart and SelectionLength properties and the Len()
function can be used together to highlight the text in a text box.
Lesson 8
1. Comparisons are made using conditional operators
| Conditional Operators |
Description |
| = |
Equal to |
| > |
Greater than |
| < |
less than |
| >= |
Greater than or equal to |
| <= |
Less than or equeal to |
| <> |
Not |
2. Decisions are reached by making comparisons.
3. Conditional operators compare values and return either true or false.
4. A boolean variable can be used to store the results of an expressions
that include conditional operators.
5. Selection (decision statements) in which a branch of code is
executed based on a true or false condition. The structures used are if,
then, end if for single selection, if, then, else, end if for
two way selection statement, and a if, then, elseif, then, else, end
if for multiple selection. The if statement is the most common
way to make a decision in a program.
6. Flowcharts allow programmer to plan and document program code using
symbols connected by lines.
7. Check boxes are used for Yes/No, or turn option on/off. Can be set
to checked or unchecked in properties.
8. Logical operators can be used to combine several comparisons into one
statement.
AND
| A |
B |
C |
Result |
| True |
True |
True |
True |
| False |
True |
True |
False |
| False |
False |
True |
False |
| False |
False |
False |
False |
OR
| A |
B |
C |
Result |
| True |
True |
True |
True |
| False |
True |
True |
True |
| False |
False |
True |
True |
| False |
False |
False |
False |
XOR
|
A |
B |
C |
Result |
| True |
True |
True |
False |
| False |
True |
True |
True |
| False |
False |
True |
True |
| False |
False |
False |
False |
Not
| A |
Result |
| True |
False |
| False |
True |
Operator Precedence used in evaluating expressions
| High |
^ |
Arithmetic |
| |
Unary + or - |
|
| |
* / \ mod |
|
| |
+ - |
|
| |
<, >, <=, >=, =, <> |
Relational |
| |
NOT |
Logical |
| |
AND |
|
| Low |
OR and XOR |
|
Lesson 9
1. If statements can be nested inside of each other. Indent the
nested if so you can keep them straight. Each If must have an Endif.
2. Radio (Option) buttons appear in groups. Only one can be active in
the group.
3. Create a GroupBox to contain the radio buttons. The controls in a
Groupbox are treated as one unit.
4. The text property of a groupbox control specifies the text that
appears at the top of the groupbox.
5. To place a radio button in a group box, click and drag to groupbox.
Do not double click.
6. The text property of a radio button specifies the text that appears
on the label attached tot he radio button.
7. Coding radio buttons involves using form-level variables that carry
values that reflect the selected radio.
8. A form's Load event procedure is executed each time the from is
loaded and opened by the program.
9. The Select Case statement allows you to make multi-way selections.
a. The case can test a range or use conditional operators. Only
selects the true.
b. When using conditional operators the Is must be used. Case is >5.
c. Case else is applied in no other case is true.
Lesson 10
1. Iteration is another word for looping. Iteration allows us to
repeat code over and over while a condition is true/false or until a
condition becomes true/false.
a.Do while test the condition at the beginning of the loop. The loop
may or may not execute once.
b. Do until test the condition at the end of the loop. The loop will
always loop once.
c. Do While age >5
Loop
d. Do
Loop until age >5
2. InputBox function creates a window that prompts the user for input.
a. text for the prompt
b. title for the window's title bar
c. optional default text for the text box.
d. InputBox(" ", " ", " ")
3. Sometimes long event procedures can make a program unresponsive to
other events.
4. An endless loop is a loop in which the condition which stops the loop
is never met.
a. Ctrl+Alt+Break will pause an endless loop.
5. The Application.DoEvents subroutine allows the program to process
other events while an event procedure is executing.
6. Loops can be nested in the same way that If statements are nested.
Lesson 11
1. ListBox control is used for displaying list of information.
a. Items.add method adds items to a listbox control
b. Items.Clear method remove entries in a listbox control.
2. For, Next loop is used for executing code a specific number of times.
a. Statements between the for and the next are executed.
b. Always involve a counter variable.
c. Step key word can be used to change increment value.
d. Step key word can be used to count backwards.
e. can be nested
f. indenting code with nested for next is helpful
3. Font property is used to change the font, style, and size of a label
Lesson 12
1. Arrays use an index or subscript to access different variable with
the same name.
2. All elements of the array are of the same data type.
3. Arrays are declared by specifying the upper bound of the array.
a. Dim intMonth(11) as Integer - reserves 12 elements -0 to 11
lowerbound=0
4. Arrays can be declared using initialization lists that set the
starting values of the array.
a. The upper bound limit is calculated by the system based on the
number of items in the list.
b. Dim StrMonth() as String={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
c. Creates a 12 element array - Jan in 0, Dec in 11.
5. Individual element in an array are read or changed by using an index
value in () to identify the element to use.
6. The GetLowerBound and GetUpperBound methods can be used to check that
an index value is in the allowable range.
7. The length method of an array returns the number of elements in an
array.
8. Arrays can be processed sequentially using a loop.
a. a loop can be used to apply the same process to each element in
an array.
b. Set each element in an array to a specific value
c. can be used to prompt for input for each element in an array and
set its value
d. can be searched by using an if statement in a loop that compares
each element of the array with a specific value.
9. Parallel arrays are any number of arrays, which may be of different
data types, that hold information in corresponding elements.
|