Visual Basic Flashcards
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability. The .NET library is available to all the programming languages that .NET supports. Present version is .NET Framework 4
Class
Classes contains the definitions of objects including properties and methods.
BUTTON object
Exit TEXT property
cmdExit_Click Click method
Classes are also referred to as templates.
Objects include?
Button, CheckBox, Label and TextBox, Listbox
Object Naming Convention
Form frm frmFileOpen
Check box chk chkReadOnly
Command Button cmd cmdExit
Label lbl lblWind
List box lst lstState
Text box txt txtLastName
Vertical Scroll Bar vsb vsbTemp
Option (Radio) Button opt optAC
Picture Box pic picJeep
Object Naming
Must begin with a letter.
Must contain only letters, numbers, and the underscore character (_).
Punctuation characters and spaces are not allowed.
Must be no longer than 40 characters
What is a event?
An event is an action performed on an object. Event-driven subroutines are always in the form:
object_Event
The subroutine “handles” the event that happens to the object.
Events example?
Click, CheckChanged, Leave, MouseEnter
Properties
A property is an attribute associated with an object. Using the dot form: object.Property
Properties can be assigned during design or run time.
Properties Examples?
Text, BackColor, ReadOnly, SelectionMode
Methods
A method is like a procedure, except that it is tied to an object (control or form), just like a property. In other words, a property is made up of data attached to the object, and a method is a procedure attached to the object. Unfortunately, methods also use the dot form:
object.Method
Additional Method vs. Object Property Information?
Furthermore, a method is invoked by simply using the method statement.
frmGetFile.Show()
Whereas an object property is only part of a statement such as assignment.
txtTemp.BackColor = Color.Red
Ways to tell methods and properties apart
Methods are usually verbs (denoting action) like Hide or Select:
frmMain.Hide()
Properties are descriptive like ForeColor or Text:
lblLetterGrade.Text=”A”
For some methods, do you specify the class from which it is called and the syntax is different?
Yes, for some methods, you must specify the class from which it is called and the syntax is different. Class.Method(arg(s))
Result = Math.Round(3.1415965,2)
txtSubtotal.Text = Convert.ToString(subtotal)
See p. 119 & 127 for additional Math & Convert class methods.
Yes, for some methods, you must specify the class from which it is called and the syntax is different. Class.Method(arg(s))
Result = Math.Round(3.1415965,2)
txtSubtotal.Text = Convert.ToString(subtotal)
See p. 119 & 127 for additional Math & Convert class methods.
Yes, for some methods, you must specify the class from which it is called and the syntax is different. Class.Method(arg(s))
Result = Math.Round(3.1415965,2)
txtSubtotal.Text = Convert.ToString(subtotal)
See p. 119 & 127 for additional Math & Convert class methods.
Preprocessor Directives Includes?
Global Items (variables & Constants)
In Visual Basic where does the execution begin?
It depends on how the user interacts with the application.