Chapter 2 Intoduction Visual Programming
Chapter 2 Intoduction Visual Programming
VISUAL PROGRAMMING
CHAPTER 2
PROGRAM AND GUI
.NET APPLICATION DEVELOPMENT
Solution Explorer
shows all the forms,
classes, references
and modules in the
project
Properties window
shows all the
properties for the
selected object
Auto Hide
Hides tool windows when not in use
Vertical push pin icon indicates auto hide is
disabled.
Click the push pin to make it horizontal and
enable auto hide.
The Code Window
Tabs at top let you toggle between the form and
the code window
Procedure box
lists events
Object box the object in
lists all the object box
objects in recognizes
the form
Object-oriented syntax:
object and property Comments
separated by dot (period) appear green
in the IDE
Understanding the IDE
Design time
When you are placing controls on the form
When you are writing code in the code
window
Runtime
When the code in your project comes to life,
responding to events
Press Start on the Debug menu in the IDE
Press the F5 key in the IDE
Press the start button in the IDE
Interfaces of VB Objects
Forms and controls are objects
Objects have interfaces:
1) Properties: typically relate to appearance of
objects
2) Events: user or system actions recognized by
the object
Procedures written to handle events
3) Methods: actions that objects are capable of
performing
1) Properties
Special types of data associated with object
Most relate to appearance of objects
Properties
A form is minimized
For now you can ignore most of this, aside from knowing the name of the
subroutine:
Comments
Explanatory remarks made within a program
Indicated by an apostrophe (‘) or the keyword
Rem
Statement categories
An executable statement causes some specific action
to be performed by the compiler or interpreter
A non executable statement is a statement that
describes some feature of either the program or its
data but does not cause the computer to perform
any action
Getting Help from the Help Menu
Enter search
term in the
Look for box
Double-click
an item in
the list box
Across
1. What is the components that use to
set an attribute for toolbox object?
4. What is the name of the Visual Studio
window that contains control that can
be dragged onto a form?
5. The ____________ properties is use
to rename the textbox name.
6. Visual Studio Integrated
Development Environment (IDE) is
used for developing applications written
in .NET, TRUE or FALSE?
Down
2. Which IDE components can listed all
the files in the solution project?
3. The ____________ properties
specifies the text that is displayed in the
title bar for form.
Learning Outcome
boxes
Create and use message box and input box in
application
Menus
MenuStrip is a container to
which ToolStripMenu Items,
ToolStripComboBoxes,
ToolStripSeparators, and
ToolStripTextBoxes can be
added
Defining Menus
ColorDialog
FolderBrowserDialog
FontDialog
OpenFileDialog
SaveFileDialog
Displaying a Windows Common Dialog Box
ColorDialog1.ShowDialog( )
FontDialog1.ShowDialog( )
Using the Information from the Dialog Box
MessageBox.Show(Text)
MessageBox.Show("Ini contoh untuk paparan
mesej sahaja")
Output:
Message
The Box
MessageBox.Show Methodox
MessageBox.Show(Text,Title)
MessageBox.Show("Ini contoh untuk paparan
mesej dan Tajuk", "Mesej")
Output:
Message
The Box
MessageBox.Show Methodox
MessageBox.Show(Text,Title,Button)
MessageBox.Show("Ini contoh untuk paparan
mesej dan Tajuk dan Button Yes dan No","Mesej",
MessageBoxButtons.YesNo)
Output:
Message
The Box
MessageBox.Show Methodox
MessageBox.Show(Text,Title,Button,Icon)
MessageBox.Show("Ini contoh untuk paparan
mesej dan Tajuk dan Button OK dan CANCEL dan
Icon Information", "Mesej",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Information)
Output:
Message
The Box ButtonsMethodox
MessageBox.Show
MessageBoxIcon.Question
Input box