Professor Corinne Hoisington Central Virginia Community College
Professor Corinne Hoisington Central Virginia Community College
NET
• Calendar Tool
• Date Picker Calendar
• Opacity Control
• Timer does not lay on form
• Command Buttons are now called
Buttons
• Use “btn” for prefix
Great New Menu Tool
More Changes
can be confusing
• Declarations section replaces
General Declarations
• Collapsible Regions in code
(Plus signs)
Collapsed Regions
Tabs
Method List
Class
List
Collapsed
Region
Collapsed
Procedure
General Changes
• There have been a number of changes in
VB .NET. General changes include:
• Form changes
• Option Strict
• Event Handler changes
• Default Properties
• Calling Subs and Functions
• Boolean operators
• Using CTRL + Space to finish variables
The Component Tray
Dim x As Integer
x = 0
If x>2 And 5\x > 1 Then ...
• This If statement is already false on
the x>2 part, but 5\x is still checked
because And does not short-circuit
• In this case, 5\x causes a “divide by
zero” error
Boolean Operators Example cont.
Dim x As Integer
x = 0
If x>2 AndAlso 5\x > 1 Then ...
• This If statement is already false on
the x>2 part, so the AndAlso does
not check the 5\x portion
• The key result: No Error!
The Value of True
• Dim x As Variant
is upgraded to:
Dim x As Object
Option Explicit
• CDec
• CStr
• VB 6.0 –
Format(variable, “Currency”)
• VB.NET – FormatCurrency(variable)
FormatPercent(variable)
FormatNumber(variable)
FormatNumber(variable,3)
FormatDateTime(variable)
New Compound Operators