Week 2: Controls and Events: Juhee Kwon IS Department, City University of HK
Week 2: Controls and Events: Juhee Kwon IS Department, City University of HK
Sep 7, 2016
Juhee Kwon
[email protected]
IS Department, City University of HK
Object-Oriented Programming
Procedural Programming
KM
KM
Check
Orders & inventories
Display Information
Display Information
Sales
Get an order
Manufacturing
CRM
Get an order
Get an order
Get an order
Send Ads
Get an orders
customer info
Get its
customer info.
Check inventories
Sales
Manufacturing
Check
inventories
CRM
Send Ads
operations.
Label
Textbox
Button
CityU of HK - IS5311
Class = car
Make : BMW
Model : 2 Series Coup
Color : Red
Year
CityU of HK - IS5311
: 2014
CityU of HK - IS5311
CityU of HK - IS5311
CityU of HK - IS5311
Project Files
When you create a new project, several more files and folders are created
by the system A project folder includes bin, My Project and obj.
CityU of HK - IS5311
Project Files
File Type
File Name
Description
Visual Studio
Solution
Week 01 Tutorial.sln
Form Files:
Week01Form.vb
Week01Form.resx
Form Designer:
Week01Form.Designer.vb
Project User
Options File:
Week 01
Tutorial.vbproj.user
Week 01
Tutorial.vbproj.user
Project Options
File:
CityU of HK - IS5311
10
Prefix
Example
Button
Btn
ex) Btnexit
Label
lb
ex) Lbname
TextBox
Txt
ex) TxtName
Radio button
Rbtn
ex) RbtnRed
CheckBox
chk
ex) ChkVisable
PictureBox
Pbox
ex) PboxSea
ListBox
Lst
ex) Lst_fruits
11
CityU of HK - IS5311
12
VB Objects
o
Text Box
Button
Label
Group Box
CheckBox
RadioButton
PictureBox
CityU of HK - IS5311
13
CityU of HK - IS5311
14
CityU of HK - IS5311
15
Text property
TextAlign property
16
2) Set Properties
Color :
Set a color in the properties window
CityU of HK - IS5311
17
Displays/contains an image
Other properties
pboxPic
18
Checked property
Checked = True/False
CityU of HK - IS5311
19
Checked property
Checked = True/False
Text property
CityU of HK - IS5311
20
CityU of HK - IS5311
actions.
oEach action by the user causes an event method to
occur.
CityU of HK - IS5311
23
Name, can
be changed.
Identifies event
CityU of HK - IS5311
24
a button
Usually, nothing happens in a Visual Basic
CityU of HK - IS5311
25
pboxPic.image =
controlName.property =
CityU of HK - IS5311
setting
26
me.close()
CityU of HK - IS5311
27
Non-executable
Automatically colored Green in Editor
CityU of HK - IS5311
28