Per 2 Why Visual Basic
Per 2 Why Visual Basic
Tahun : 2005
Versi :
Pertemuan 02
Visual Basic Environment and Control
1
Learning Outcomes
2
Outline Materi
• Design Mode
– Placing, arranging, and customizing the appearance of buttons,
labels, and other controls on a form.
– Writing processing scripts (source code).
– Saving the solution.
– Making an executable file.
• Run Mode
– Executes the solution.
– Used to evaluate the workability of a part of the project.
– Used to show the user how the solution will work.
• Break Mode
– Helps the developer with debugging.
– Enables the developer to switch back to run mode or design
mode.
5
VB Integrated Development
Environment (IDE)
Form Window
Tool
box Properties
Window
Form
layout Project
window Explorer
window
6
Visual Basic Controls
7
Windows Form Control
8
Button Control
9
Label Control
10
Textbox Control
• Provides an area for the user to type while the program runs.
• Appearance and Use:
– Displays as a rectangular area that provides the user a place to type.
– You can limit the user types
– You can also surround the TextBox with a border.
• Properties:
– Some of the TextBox control properties are only available at run time.
– The value of the Text property is used most frequently.
– Control of user entry is shared between properties and events.
– The PasswordChar property allows you to set a security character.
– TextLength property determines the number of characters contained in a textbox.
– Selection… properties provide information on user selections in the TextBox control.
• Events:
– Focus means the user is currently working with the specific control.
• Enter - Occurs when input focus is received.
• KeyPress - Occurs when a key is pressed while the control has focus.
• Leave – Occurs when input focus leaves the control.
– Methods
• Enable the developer to manipulate text in a TextBox.
• Many are available to the developer.
11
MsgBox Statement
3
3
1
1
2
2
12
Inputbox Function
13