Fundamentals of Programming in VB.NET

Slides:



Advertisements
Similar presentations
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Advertisements

Chapter 2 –Visual Basic, Controls, and Events
Fundamentals of Programming in Visual Basic
Fundamentals of Programming in Visual Basic
Chapter 3.3 Numeric Data Types and Variables. Slide 2 Objectives Create variables to store information while a solution runs Perform computations with.
Chapter 31 Fundamentals of Programming in VB(Continue I) Numbers Arithmetic Operations Variables Incrementing the Value of a Variable.
Chapter 2 –Visual Basic, Controls, and Events
Variables & Math Operators CE 311 K - Introduction to Computer Methods Daene C. McKinney.
Chapter 3 - VB 2008 by Schneider1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
Chapter 31 Fundamentals of Programming in Visual Basic (Continue VI) String Properties and Methods: "Visual".Length is 6. "Visual".ToUpper is VISUAL. "123.
1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
Input/Output CE 311 K - Introduction to Computer Methods Daene C. McKinney.
CS0004: Introduction to Programming Variables – Numbers.
CS0004: Introduction to Programming Input and Output.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
Chapter 3 - VB 2005 by Schneider1 Chapter 3 – Fundamentals of Programming in Visual Basic 3.1 Visual Basic Controls 3.2 Visual Basic Events 3.3 Numbers.
CS0004: Introduction to Programming Variables – Strings.
1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
Chapter 3 - VB 2008 by Schneider1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Chapter 2 –Visual Basic, Controls, and Events
1 Chapter 3 – Fundamentals of Programming in Visual Basic 3.1 Visual Basic Controls 3.2 Visual Basic Events 3.3 Numbers 3.4 Strings 3.5 Input and Output.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Numbers continued The Integer Data Type Multiple Declarations Parentheses Three Types of Errors.
3.2 VB.NET Events An Event Procedure Properties and Event Procedures of the Form Tab Order of Controls Exercises.
Variables & Function Calls. Overview u Variables  Programmer Defined & Intrinsic  Data Types  Calculation issues u Using Functions  The val() function.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
Introduction to Programming Fundamentals of Programming in Visual Basic.
1 Chapter 3 – Examples The examples from chapter 3, combining the data types, variables, expressions, assignments, functions and methods with Windows controls.
CS4 –lecture 6 Wednesday, Jan 19, 2011 Roxana Gheorghiu.
Chapter 31 Fundamentals of Programming in Visual Basic (VB) Visual Basic Events Simple Statement.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
3.4 Strings Variables and Strings Using Text Boxes for Input and Output Concatenation ANSI Character Set String Properties and Methods: LengthToUpper TrimToLower.
Chapter 31 Fundamentals of Programming in Visual Basic (VB) Visual Basic Events Simple Statement.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Chapter 3 - VB 2008 by Schneider1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
A variable is a name for a value stored in memory.
Topics Designing a Program Input, Processing, and Output
Chapter 3 – Fundamentals of Programming in Visual Basic
Chapter 3 – Variables, Input, and Output
Variables and Arithmetic Operations
The Selection Structure
Do Now: What are the three steps to writing a Visual Basic Program?
Chapter 3 – Variables, Input, and Output
Variables and Arithmetic Operations
Introduction to C++ Programming
WEB PROGRAMMING JavaScript.
Chapter 3 – Variables, Input, and Output
Numbers.
Strings(Part 1) String Literal and String Variable
String Variable, Methods and Properties
Section 3.3 Numbers Arithmetic Operations Variables
Variable Review & IO User 12/26/2018.
Chapter 3.5 Input and Output
Input and Output.
String Variable, Methods and Properties
Additional Topics in VB.NET
Fundamentals of Programming in VB.Net
Topics Designing a Program Input, Processing, and Output
String Variable, Methods and Properties
Introduction to Programming
Topics Designing a Program Input, Processing, and Output
String Variable, Methods and Properties
Input and Output.
Input and Output Chapter 3.5
Presentation transcript:

Fundamentals of Programming in VB.NET Chapter 3 Fundamentals of Programming in VB.NET 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net VB.NET Controls 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Add an "access key" 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net The Name Property How the programmer refers to a control in code Name must begin with a letter Must be less than 215 characters long May include numbers and the underscore Use appropriate 3 character naming prefix 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Control Name Prefixes 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net VB.Net Events 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net VB.NET Events An Event Procedure Walkthrough Properties and Event Procedures of the Form The Declaration Statement of an Event Procedure 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net What is an event? An event is an action, such as the user clicking on a button Usually, nothing happens until the user does something and generates an event 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net VB.NET program: Create the interface; that is, generate, position, and size the objects. Set properties; that is, configure the appearance of the objects. Write the code that executes when events occur. This block of code is called event procedure. 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Event Procedures Private Sub objectName_event( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles objectName.event statements End Sub Private Sub ObjectName_event(…) Handles objectName.event Because the book does not make use of the parameter list, it is replaced with an ellipsis 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Statements Properties of controls can be changed both in the Properties window and in the statements of the event procedure. The statement we use to change the property value is call an Assignment statement 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Changing Properties Properties are changed in code with the following: controlName.property = setting This is an assignment statement txtBox.ForeColor = Color.Red Me.Text = "Demonstration“ Instead of (VB.6) Form1.Text = "Demonstration" The form is referred to by the keyword Me. The setting value on the right hand side of the equal sign is being assigned to the property of the control listed on the left hand side of the equal sign 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Program Region 11/30/2018 Fundamentals of Programming in VB.Net

Dropdown Boxes Automatically pops up to give the programmer help. 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Help Help menu Press ALT/H/I - Help index window Dynamic help – samples (Member Listing) Type dot “.” following a word Type parenthesis following a word Context-sensitive help Place cursor on the word, and press F1 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Event Outcomes Private Sub txtFirst_TextChanged(...) Handles txtFirst.TextChanged txtFirst.ForeColor = Color.Blue End Sub Private Sub btnRed_Click(...) Handles btnRed.Click txtFirst.ForeColor = Color.Red Private Sub txtFirst_Leave(...) Handles txtFirst.Leave txtFirst.ForeColor = Color.Black 11/30/2018 Fundamentals of Programming in VB.Net

The Declaration Statement of an Event Procedure A declaration statement for an event procedure: Private Sub btnOne_Click(...) Handles btnOne.Click The name can be changed at will. Private Sub ButtonPushed(...) Handling more than one event: Handles btnOne.Click, btnTwo.Click btnOne_Click is the name of the event procedure, and btnOne.Click identifies the event that triggers the procedure Also, an event procedure can be triggered by more than one event. 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Numbers 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Numbers Integer and Float Point Number Arithmetic Operations Variables Built-In Functions: Math.Sqrt Int Math.Round 11/30/2018 Fundamentals of Programming in VB.Net

Arithmetic Operations Numbers are called numeric literals Five arithmetic operations in VB.NET + addition 3 + 2 - subtraction 3 - 2 * multiplication 3 * 2 / division 3 / 2 ^ exponentiation 3 ^ 2 11/30/2018 Fundamentals of Programming in VB.Net

Parentheses of Arithmetic operation Order of Operation: () Inner to outer,left to right ^ Left to right in expression * / Left to right in expression + - Left to right in expression 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Scientific Notation Scientific notation represents a number by using power of 10 to stand for zeros In VB.Net b • 10 r is written as bEr 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Scientific Notation r is a two digit number preceded by plus sign if r is positive and by a minus sign if r is negative 10 • 10 –20 10 ^ - 20 1E-20 1.2 • 10 3 1.2 * 10 ^ 3 1.2E+03 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Variables A variable is a name that is used to refer to an item of data. The value assigned to the variable may change. Up to 16,838 characters long Begin with a letter or an underscore Consist of only letters,digits and underscores A Variable name is written in lowercase letters except for the first letters of additional words, such as costOfIT201. 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Variables Declaration: Dim speed As Double Data type Variable name Assignment: speed = 50 11/30/2018 Fundamentals of Programming in VB.Net

Variable Initialization Numeric variables are automatically initialized to 0: Dim varName As Double To specify a nonzero initial value Dim varName As Double = 50 declares a variable named varName to be of type Double. Actually, the Dim statement causes the computer to set aside a location in memory with the name varName. Since varName is a numeric variable, the Dim statement also places the number zero in that memory location. (We say that zero is the initial value or default value of the variable.) 11/30/2018 Fundamentals of Programming in VB.Net

Increment variable value To add 1 to the numeric variable var var = var + 1 Or as a shortcut var +=1 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Built-in Functions Functions associates with one or more values and returns a value(output) Math.sqrt(n): Returns the square root of n. Math.Sqrt(9) is 3 Int(n): Returns greatest integer less than or equal to n Int(9.7) is 3 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Built-in Functions Math.Round(n, r): number n rounded to r decimal places Math.Round(2.317,1) is 2.3 Math.Round(2.7) is 3 When n is halfway between two successive whole number, then it rounds to the nearest even number Math.Round(2.5) is 2 Math.Round(3.5) is 4 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Integer Data Type An integer is a whole number Declaring an integer variable: Dim varName As Integer 11/30/2018 Fundamentals of Programming in VB.Net

Multiple Declarations multiple-declaration statements : Dim a, b As Double Dim a As Double, b As Integer Dim c As Double = 2, b As Integer = 5 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Three Types of Errors Syntax error – grammatical errors misspellings, omissions,incorrect punctuation Run-time error occurs when program is running Logic error program doesn’t perform as it is intended 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Strings 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Strings 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Strings String literal a sequence of characters treated as a single item, surrounded by “” String variable a name used to refer to a string Dim varName As String 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Variables and Strings Private Sub btnDisplay_Click(...) Handles btnDisplay.Click Dim today As String today = "Monday" With lstOutput.Items .Clear() .Add("hello") .Add(today) End With End Sub 11/30/2018 Fundamentals of Programming in VB.Net

Using Text Boxes for Input and Output The contents of a text box is a string input strVar = txtBox.Text Output (ReadOnly = true) txtBox.Text = strVar 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Data Conversion Type-casting Converts data from one type to another such as CDblr, Cint, CStr 11/30/2018 Fundamentals of Programming in VB.Net

Data Conversion numVar = CDbl(txtBox.Text) txtBox.Text = CStr(numVar) Converts a String to a Double Converts a number to a string CType(numVar,string) Convert.ToString(numVar) numVar.ToString Str(numVar) 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Data Conversion All conversions to String are considered to be widening, regardless of whether strict semantics are used. Special case Nothing - empty string literal "" 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Concatenation Combining two strings into a new string.Concatenation is represented by “&” Dim str1 As String = “My GPA is A " Dim Str2 As String = “in Winter 2002" txtOutput.Text = str1 & str2 displays My GPA is A in Winter 2002 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Concatenation Combining strings with numbers into a string Dim str1 As String = “My grade is “ Dim grade As Double = 89 Dim str2 As String = “in Winter 2002" txtOutput.Text = str1 & grade & str2 displays My GPA is 89 in Winter 2002 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net ANSI Character Set A numeric representation for every key on the keyboard. The numbers are ranging from 32 to 255 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net ANSI Character Set If n is between 32 and 255, str Chr(n):returns the string consisting of the character with ANSI value n Chr(65) ----- A Asc(str):returns the ANSI value of the first character of str Asc(“Apple”) --- 65 32 & Chr(176) & “Fahrenheit -- 32° Fahrenheit 11/30/2018 Fundamentals of Programming in VB.Net

String Properties and Methods A string is an object, like controls, has both properties and methods. Length ToUpper Trim ToLower IndexOf Substring 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net String Properties str.Length: the number of characters in str “Tacoma".Length is 5 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net String methods str.ToUpper with all letters of str capitalized “Tacoma".ToUpper is TACOMA. str.ToLower with all letters of str in lowercase format “TCC1926".ToLower is tcc1926 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net String Methods str.Trim with all leading and trailing spaces deleted “IT” & “ 201 ".Trim is IT201 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net String Methods str.Substring(m,n) substring consisting of n characters beginning with the character in position m in str “Washington”.Substring(0,4) is “Wash” str.Substring(m) substring beginning with the character in position m in str until the end of str “Washington”.Substring(2) is “shington” 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net String Methods str.IndexOf(substr) -1 if substr is a substring of str beginning position of the first occurrence of substr in str "fanatic".IndexOf("ati") is 3. "fanatic".IndexOf("nt") is –1. 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net String Methods str.IndexOf(substr,n) the position of the first occurrence of substr in str in position n or greater "fanatic".IndexOf(“a”, 3) is 3. 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net The Empty String zero-length string "" lstBox.Items.Add("") skips a line txtBox.Text = "“ or txtBox.Clear() clear the text box 11/30/2018 Fundamentals of Programming in VB.Net

Initial Value of a String A string should be assigned a value before being used By default the initial value is Nothing Strings can be given a different initial value as follows: Dim today As String = "Monday“ 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Option Strict The Option Strict statement must appear before any other code Restricts implicit data type conversions to only widening conversions Provides compile-time notification of data lost conversions Generates an error for any undeclared variable 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Option Strict The default is Off Option Strict { On | Off } On: Optional. Enables Option Strict checking Off : Optional. Disables Option Strict checking 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Option Strict Example Option Strict On Dim MyVar As Integer Dim Obj As Object MyVar = 1000 MyVar = 1234567890.987654321 ‘ Data lost MyInt = 10 ' Undeclared variable 11/30/2018 Fundamentals of Programming in VB.Net

Internal Documentation Begin the line with an apostrophe Benefits: Easy to understand the program Easy to read long programs because the purposes of individual pieces can be determined at a glance. 11/30/2018 Fundamentals of Programming in VB.Net

Line-Continuation Character A long line of code can be continued on another line by using underscore (_) preceded by a space msg = "640K ought to be enough " & _ "for anybody. (Bill Gates, 1981)" 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Input and Output 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Input and Output Formatting Output with Format Functions Formatting Output with Zones Reading Data from Files Getting Input from an Input Dialog Box Using a Message Dialog Box for Output 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Format Functions FormatNumber(n,r) FormatCurrency(n,r) FormatPercent(n,r) return a string value n - a number, an numeric expression or a string to be formatted r - the number of decimal places default value is 2 11/30/2018 Fundamentals of Programming in VB.Net

Formatting Output with Format Functions String Value FormatNumber(12345.628,1) FormatNumber(1 + 2) 12,345.6 3.00 FormatCurrency(12345.628,2) FormatCurrency(-100) $12,345.63 ($100.00) FormatPercent(0.185,2) FormatPercent(“0.07”) 18.50% 7.00% 11/30/2018 Fundamentals of Programming in VB.Net

Formatting Output with Zones Line up items in columns Use a fixed-width font such as Courier New Divide the characters into zones with a format string. 11/30/2018 Fundamentals of Programming in VB.Net

Formatting output with zones Zone width Dim fmtStr As String = "{0, 15}{1, 10}{2, 8}“ lstOutput.Items.Add(String.Format(fmtStr, _ data0, data1, data2)) Zone number 11/30/2018 Fundamentals of Programming in VB.Net

Formatting output with zones A colon and formatting symbol after width to specially format numeric data Zone Format Number to be formatted Number displayed {1,12:N3} 1234.5679 1234.568 {1,12:N0} 34.6 34 {1,12:C1} 1234.567 $1234.6 {1,-12:P} 0.569 56.90% 11/30/2018 Fundamentals of Programming in VB.Net

Formatting Output with Zones Zone width left adjusted if preceded with minus sign, right adjusted otherwise Spaces between the successive pairs of brackets will be displayed in the corresponding zones in the output. 11/30/2018 Fundamentals of Programming in VB.Net

Formatting Output with Zones Dim fmtStr As String = “{0,10} {1,12}” With 1stOutput.Items .Add(“123”) End With Displays 123 123 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Inputting Data Read data stored in files and accessed with a StreamReader object Supplied by the user with an input dialog box. InputBox(prompt, title) 11/30/2018 Fundamentals of Programming in VB.Net

Fundamentals of Programming in VB.Net Input data from a file Establish a communication link between computer and the disk drive for reading data from disk Dim readerVar As IO.StreamReader = _ IO.File.OpenText(filespec) Read data in order, one at a time, from the file with the ReadLine method assuming the file contains one item of data per line. strVar = readerVar.ReadLine terminate the communications link readerVar.Close() 1. Execute a statement of the form Dim readerVar As IO.StreamReader A StreamReader is an object from the Input/Output class that can read a stream of characters coming from a disk or coming over the Internet. The Dim statement declares the variable readerVar to be of type StreamReader. 2. Execute a statement of the form readerVar = IO.File.OpenText(filespec) where filespec identifies the file to be read. This statement establishes a communi-cations link between the computer and the disk drive for reading data from the disk. Data then can be input from the specified file and assigned to variables in the pro-gram. This assignment statement is said to “open the file for input.” Just as with other variables, the declaration and assignment statements in Steps 2 and 3 can be combined into the single statement Dim readerVar As IO.StreamReader = IO.File.OpenText(filespec) 3. Read items of data in order, one at a time, from the file with the ReadLine method. Each datum is retrieved as a string. A statement of the form strVar = readerVar.ReadLine causes the program to look in the file for the next unread line of data and assign it to the variable strVar. The data can be assigned to a numeric variable if it is first converted to a numeric type with a statement such as numVar = CDbl(readerVar.ReadLine) Note: If all the data in a file have been read by ReadLine statements and another item is requested by a ReadLine statement, the item retrieved will have the value Nothing. 4. After the desired items have been read from the file, terminate the communications link set in Step 3 with the statement readerVar.Close() 11/30/2018 Fundamentals of Programming in VB.Net

Getting Input from an Input Dialog Box stringVar = InputBox(prompt, title) fileName = InputBox("Enter the name " _ & "of the file containing the " & _ "information.", "Name of File") 11/30/2018 Fundamentals of Programming in VB.Net

Using a Message Dialog Box for Output MsgBox(prompt, , title) MsgBox("Nice try, but no cigar.", , "Consolation") MsgBox(prompt, , title) is executed, where prompt and title are strings, a message dialog box appears with prompt displayed and the title bar caption title and stays on the screen until the user presses Enter, clicks on the box in the upper-right corner, or clicks OK. For instance, the state-ment MsgBox("Nice try, but no cigar.", , "Consolation") 11/30/2018 Fundamentals of Programming in VB.Net