Download presentation
Presentation is loading. Please wait.
Published byThomasine Doyle Modified over 6 years ago
1
CS 2340: Programming in VB Instructor: Dr. Qi Yang Office: 213 Ullrich
Phone: YangQ
2
Web Sites http://people.uwplatt.edu/~yangq/cs234/
3
Three VB.NET Courses CS 2340: Programming in VB Prerequisite: CS1430
CS 3340: Windows Programming Prerequisite: CS2340 & CS2430 or CS2630 CS 3870: Web Protocols, Technologies and Applications Prerequisite: CS3340 Co-requisite: CS3630 (Database)
4
CS 2340: Course Description
An introduction to event driven, object oriented programming techniques in VB.NET. Students will design, code, and debug Graphic User Interface (GUI) programs and apply the techniques to business applications.
5
CS 2340: Course Outcomes Upon completion of this course, students should be able to Design and develop Graphical User Interfaces; Understand and code Event-Driven procedures; Program Visual Basic controls proficiently; Access database from VB.NET programs; and Design, develop and test VB.NET programs.
6
CS 2340: Textbook Beginning VB.NET, 2nd Edition, Wrox Not .NET 2015
7
Academic Misconduct
8
CS 2340: Course Work 8 Labs 160 (10 – 30 each)
6 Tests (20 – 40 each) 1 Project Total
9
New Grading System No Curve
Course Grade Points Percentage Grade Points A % A % B % B % B % C % C % C % D % D % F below No Curve
10
Journal of Information Systems Education
Hands-on Tests In all three VB courses Paper published in Journal of Information Systems Education Volume 16, Number 2, Summer 2005
11
Different Backgrounds
CS 2340: Programming in VB Different Backgrounds If you have a very good background You should get an A You may not get an A Else If you have a good background You do not want to get a D Else (Don’t have any background in VB) You can get an A! Come to class every day and do your work!
12
CS 2340: Programming in VB Every one could get an A!
That has never happened! Every one should pass CS 2340! That has never happened either! Just Do It!
13
Due 9 PM, Monday, September 12, 2011
Lab 1 10 points Due 9 PM, Monday, September 12, 2011 No Grace Time!
14
MS Visual Studio Every PC in Ullrich Free Copy on your PC
Will receive about it Follow instructions to get your copy Start VS 2015 Sign in: up to you (not now, maybe later) Development Settings: Visual Basic
15
Create a VB.NET Solution
Start MS Visual Studio (Environment: Basic) New Project… Visual Basic Windows Windows Form Application Name: UserName_Lab1 YangQ_Lab1 Create directory for solution: Uncheck Location: Remember where is your program!
16
Save Project and Solution
Make sure you know where is your program! Save all Create Solution folder: Uncheck Browse location Check program location
17
MS Visual Studio IDE (Integrated Development Environment)
Title Bar Menu Bar Tool Bars Solution Explorer Properties Window ToolBox Auto Hide Docked, Floating and Tabbed Document Right click the title bar of the window or Drag the window to the position you want
18
Menu Bar / Tools / Options
MS Visual Studio IDE IDE Settings Menu Bar / Tools / Options Environment Document Detect when file is changed outside the environment: Uncheck Projects and Solutions Always show solution: Check Save new projects when created: Check Text Editor Basic Tabs: Tab size : 3 Indent size: Same as Tab size Windows Forms Designer …
19
MS Visual Studio IDE View Help Visual Studio 2015 Search Google
20
Properties Window Right click the form Properties Events Alphabetical
Categorized
21
Form Properties Name: frmLab1 Text Size FormBorderStyle StartPosition
WindowState . . .
22
ToolBox Most controls available on ToolBox Tabs on ToolBox
All Windows Forms Common Controls Putting a control on form Double Click Drag and Drop
23
Windows Controls Form frmLab1 TextBox Get Input Display Output txtName
Label Display Information / Output lblName Button User action btnHello . . .
24
Click Event The button’s Click Event
Users click a button when they want to do something. Event Procedure VB function that will be called when the event happens We will write the event procedure Click Event procedure template Double click the button
25
Declaring Variables Dim theName As String theName = txtName.Text
‘ This is comment ‘ To remove spaces from both ends theName = txtName.Text.Trim() We should get variable values from controls at the beginning, then use the variables, not the controls, in the code.
26
Class MessageBox Method Show MessageBox.Show(“Please Enter Your Name”)
Caption (Title), MessageBoxButtons and MessageBoxIcon MessageBox.Show("Enter Your Name Please!", _ "Lab 1", MessageBoxButtons.OK, _ MessageBoxIcon.Exclamation) Line continuation char: “ _” VB has NO statement terminator
27
VB.NET is Getting Smarter!
MessageBox.Show("Enter Your Name Please!", "Lab 1", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
28
String Operations ‘ Operators “&” and “+” append strings
MessageBox.Show("Hello, " & theName + "!”) MessageBox.Show("Hello, " & theName + "!", "Lab 1”, MessageBoxButtons.OK, MessageBoxIcon.Information)
29
If Statement If theName = "" Then
MessageBox.Show("Enter Your Name Please!", "Lab 1", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Else MessageBox.Show("Hello, " & theName + "!", "Lab 1", MessageBoxIcon.Information) End If
30
The Click Event Procedure
Private Sub btnHello_Click(...) Handles btnHello.Click Dim theName As String theName = txtName.Text.Trim() If theName = "" Then MessageBox.Show("Enter Your Name Please!", "Lab 1", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Else MessageBox.Show("Hello, " & theName + "!", "Lab 1", MessageBoxIcon.Information) End If End Sub
31
Grader Down load the grader program with the input file
Put both files in the same folder as your exe file (normally bin/debug) Select your exe file and the downloaded input file Run the grader program and click Single EXE File
32
Grader All controls, including the forms, MUST have the correct names
Otherwise, your receive ZERO points!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.