Vbproj
Vbproj
Vbproj
BASIC6.0
Prof. Anil Khadse
Visual Basic 6.0
VB is an Event- Driven programming
VB has different objects called Forms and Controls.
Each object has its own properties (Colour, height, name etc)
Properties
window
Tool
bar
Form
window
Propertie
FIG 1.2 COMPONENTS OF WINDOW s layout
Tool box Prof Anil Khadse window
MENU BAR AND TOOL BAR
Menu
bar
MENU BAR-
FIG 1.4 MENU BAR AND TOOL BAR
View Select
Code form
View
object
edges or corners.
Properties:
Caption : it sets the title of the form
Name :it gives the name of the form with which it is
referred to in the code. The default value is form.
Appearance: value 1 makes the form look like
three- Dimensional.Value 0 makes the form look
flat.
Font:it sets the font type ,font style and font size
for the text.
Fore color :it sets the color for the text on the form.
Enabled:value true makes the form respond to
mouse And keyboard events.Value false makes
the form responding to any event.
Back color:it sets the form’s background color.
Visible: value false makes the form invisible
e.g Amt=2564.5643
FormatNumber(Amt,2) will display 2,564.56
FormatNumber(Amt,0) will display 2,565
Prof Anil Khadse
Simple project in VB
Object property Value
Form Name frmTybcom
Caption My First Form
Label Name lblName
Caption Good Morning Students
Command Button Name cmdWelcome
Caption &Welcome
Command Button Name cmdExit
Caption &Exit
Enter Number1
Enter Number2
SUM IS
No. of years
Rate of Interest
Interest Amount
Caption DA
OK 0 vbOKOnly No Icon
Critical Message 16 vbCritical
Icon
Warning Query 32 vbQuestion
Icon
Warning Message 48 vbExclamation
Information 64 vbInformation
Message
For E1 = E2 To E3 Step E4
----------------
---------------- Statements to be repeated
Next E1
Prof Anil Khadse
Where E1 = Control or Index Variable
E2 = Initial value
E3 = Final value
E4 = Increment in E1 after every repetition
Example
For I=1 to 5
Sum=Sum+I
Next I