1. s:\courses\csse\ibrahima\cs2340\notes folder section1 folder section2 2
TRANSCRIPT
1
CS 2340Programming in VB.NET
S:\Courses\CSSE\ibrahima\CS2340\Notes
Folder Section1Folder Section2
2
Notes Folder
Start MS Visual Studio 2012 New Project… Visual Basic Windows Windows Form Application Name: ibrahima_XXXn
4
Create a New Project
Make sure you know where is your program!
Save all Create Solution folder: Uncheck Browse location Could change project / solution names Check program location
5
Save Project and Solution
Double click the project file Double click the solution file Open MS Visual Studio, then
Open project Recent projects
6
Reopen an Existing Project
TextBox Get Input Display Output
Label Display Information / Output
Button User action. . .
7
Windows Controls
Name: lblName Font
◦ Name◦ Size◦ Bold◦ Italic◦ Strikeout◦ Underline
Size AutoSize TextAlign . . .
8
Label
Name: txtName Size Multiline ReadyOnly BackColor TabStop TabIndex . . .
9
TextBox
Name: btnHello Text TextAlign Size TabStop TabIndex . . .
10
Button
Menu View Tab Order Clicking the controls in order to change
TabIndex Close Tab Order Multiple controls could receive the same
TabIndex value
11
Changing TabIndex
Align ◦ Tops ◦ Lefts ◦ ...
Make Same Size
12
Menu Format
Horizontal Spacing Vertical Spacing Center in Form
◦ Horizontally ◦ Vertically
13
Menu Format
Order ◦ Bring to Front ◦ Send to Back
Lock Controls
14
Menu Format
The button’s Click Event Users click a button when they want to
do something.
Event Procedure Will be called when the event happens.
We will write the event procedure
Event procedure template Double click the button Select Events on Properties Windows 15
Click Event
Declare variables
Get Input
Process Data
Output Result
16
Event Procedure Pseudo Code
‘ Operators “&” and “+” append stringsMessageBox.Show("Hello, " & theName + "!”)
MessageBox.Show("Hello, " & theName + "!", "Lab 1”, _ MessageBoxButtons.OK, _ MessageBoxIcon.Information)
17
String Operations