You are on page 1of 9

Management Information System - Lab Programs

Index
S.No Date Name of the Experiment Page No
1 24-07-2019 Introduction to M.S. Access
2 14-08-2019 Form Creation for Customer Details
3 04-09-2019 Report Generation for Employee table
4 11-09-2019 Display Different Shapes
5 18-09-2019 Simple Interest
6 16-10-2019 Changing Background and Foreground
Colour at Random
7 23-10-2019 Mathematical Table
8 30-10-2019 Display Calendar

Page 1 of 9
1. Display Different Shapes
Aim: To design a Visual Basic Application, to display different shapes using shape control.

Procedure:

Step1: Select start button → All Programs →Microsoft Visual Studio 6.0→Microsoft Visual
Basic6.0

Step2: In new project window select standard exe icon and click on open button.

Step3: Using the tool box insert one Label, Seven Command buttons and one Shape tool
and arrange all the controls in a meaningful manner.

Step4: Using the properties window change the properties of different controls in the
following manner.

Control Property Value


Label1 Caption Display a different shapes
Label1 Font style & size 18
Command1 Caption Rectangle
Command2 Caption Square
Command3 Caption Oval
Command4 Caption Circle
Command5 Caption Rounded Rectangle
Command6 Caption Rounded Square
Command7 Caption Quit

Step5: Open the code window using the view →code option and write the following code.

Private Sub Command1_Click()


Shape1.Shape = 0
End Sub
Private Sub Command2_Click()
Shape1.Shape = 3
End Sub
Private Sub Command3_Click()
Shape1.Shape = 1
End Sub
Private Sub Command4_Click()
Shape1.Shape = 2
End Sub
Private Sub Command5_Click()
Shape1.Shape = 4
End Sub
Private Sub Command6_Click()

Page 2 of 9
Shape1.Shape = 5
End Sub
Private Sub Command7_Click()
End
End Sub

Step6: Save the project using the File menu →Save Project command. And also save the
form as same way.

Step7: Run the form using Run menu→ Start Command or press F5 from keyboard.

Out Put:

2. Simple Interest
Aim: To Create a project to calculate Simple Interest using Visual Basic6.0.

Procedure:

Step1: Select start button → All Programs →Microsoft Visual Studio 6.0→Microsoft Visual
Basic6.0

Step2: In new project window select standard exe icon and click on open button.

Step3: Using the tool box inserts 5 Labels, 3 Command buttons and 4 Text Boxes and
arranges all the controls in a meaningful manner.

Step4: Using the properties window change the properties of different controls in the
following manner.

Page 3 of 9
Control Property Value
Label1 Caption Simple Interest
Label1 Font style & size 18
Label2 Caption Enter Principle Amount
Label3 Caption Enter time period
Label4 Caption Enter Rate of Interest
Label5 Caption Simple Interest Is
Text1 Name P
Text1 Text (Remove all The data) Empty
Text2 Name Q
Text2 Text (Remove all The data) Empty
Text3 Name R
Text3 Text (Remove all The data) Empty
Text4 Name SI (Simple Interest)
Text4 Text (Remove all The data) Empty
Command1 Caption Calculate
Command2 Caption Clear
Command3 Caption Quit

Step5: Open the code window using the view →code option and write the following code.

Private Sub Command1_Click()


SI = Val(P) * Val(T) * Val(R) / 100
End Sub

Private Sub Command2_Click()


P=""
T=""
R=""
SI = " "
End Sub

Private Sub Command3_Click()


End
End Sub

Step6: Save the project using the File menu →Save Project command. And also save the
form as same way.

Step7: Run the form using Run menu→ Start Command or press F5 from keyboard.

Step8: Enter the values for the required text boxes and press “Calculate “button then it
displays simple Interest.

Step9: To clear the value of the text boxes press “Clear “button.

Page 4 of 9
Out Put:

3. Changing Background and Foreground Colour at Random


Aim: To create a Visual Basic 6.0 application to changing the background and fore
ground colour randomly.

Procedure:

Step1: Select start button → All Programs →Microsoft Visual Studio 6.0→Microsoft Visual
Basic6.0

Step2: In new project window select standard exe icon and click on open button.

Step3: Using the tool box inserts 1 Label and 3 Command buttons and arranges all the
controls in a meaningful manner.

Step4: Using the properties window change the properties of different controls in the
following manner.

Control Property Value


Label1 Caption Please change my colour
Label1 Name LblMessage
Command1 Caption Change Background Color
Command1 Name Cmd_bgcolor
Command2 Caption Change Foreground Color
Command2 Name Cmd_fgcolor
Command3 Caption Quit

Step5: Open the code window using the view →code option and write the following code.

Page 5 of 9
Private Sub Cmd_bgcolor_Click()
Dim r, g, b As Integer
r = Int(Rnd() * 256)
g = Int(Rnd() * 256)
b = Int(Rnd() * 256)
MyForm.BackColor = RGB(r, g, b)
End Sub

Private Sub Cmd_fgcolor_Click()


Dim r, g, b As Integer
r = Int(Rnd() * 256)
g = Int(Rnd() * 256)
b = Int(Rnd() * 256)
LblMessage.ForeColor = RGB(r, g, b)

End Sub

Private Sub Command1_Click()


End
End Sub

Step6: Save the project using the File menu →Save Project command. And also save the
form as same way.

Step7: Run the form using Run menu→ Start Command or press F5 from keyboard.

Out Put:

Page 6 of 9
4. Mathematical Table

Aim: To Design a Visual Basic Application to display a Mathematical Table.

Procedure:

Step1: Select start button → All Programs →Microsoft Visual Studio 6.0→Microsoft Visual
Basic6.0

Step2: In new project window select standard exe icon and click on open button.

Step3: Using the tool box inserts 1 Text box, 1 List box and 2 Command buttons and
arranges all the controls in a meaningful manner.

Step4: Using the properties window change the properties of different controls in the
following manner.

Control Property Value


Textbox1 Name txtN
Command1 Name btnCalculate
Command1 Caption Tell Me My Table
Command2 Caption Quit
Step5: Open the code window using the view →code option and write the following code.

Private Sub btnCalculate_Click()


Dim Number1 As Integer
Dim i As Integer
Number1 = Val(txtN.Text)
For i = 1 To 10
List1.AddItem (Number1 & "X" & i & "=" & (Number1 * i))
Next
End Sub

Private Sub Command1_Click()


End
End Sub
Step6: Save the project using the File menu →Save Project command. And also save the
form as same way.

Step7: Run the form using Run menu→ Start Command or press F5 from keyboard.

Page 7 of 9
Out Put:

5. Display Calendar
Aim: To create a Visual Basic Application to display a calendar for a given month and
year.

Procedure:

Step1: Select start button → All Programs →Microsoft Visual Studio 6.0→Microsoft Visual
Basic6.0

Step2: In new project window select standard exe icon and click on open button.

Step3: Using the tool box inserts 1 Label, 3 Command buttons and 1 Calendar control in the
form and arranges all the controls in a meaningful manner.

Step4: Select Project menu → Components → Controls→ Microsoft Calendar Control 8.0
and click on Check box and then Click on Apply/ Ok button.

Step5: Using the properties window change the properties of different controls in the
following manner.

Control Property Value


Label1 Caption Display a calendar for a given
month and year
Command1 Caption Month
Command2 Caption Year
Command3 Caption Quit

Step6: Open the code window using the view →code option and write the following code.

Page 8 of 9
Private Sub Command1_Click()
Dim y As Integer
y = InputBox("Enter Year(YYYY)")
If (y < 1900) Then
MsgBox (Val(y) & " is Invalid Year, Please enter valid year")
Else
MsgBox (Val(y) & " is Valid Year")
Calendar1.Year = Val(y)
End If
End Sub

Private Sub Command2_Click()


Dim m As Integer
m = InputBox("Enter Month(1-12)")
If (m > 12) Then
MsgBox (Val(m) & " is Invalid Month please enter valid month")
Else
MsgBox (Val(m) & " is Valid Month")
Calendar1.Month = Val(m)
End If
End Sub

Private Sub Command3_Click()


End
End Sub

Step7: Save the project using the File menu →Save Project command. And also save the
form as same way.

Step8: Run the form using Run menu→ Start Command or press F5 from keyboard.

Out Put:

Page 9 of 9

You might also like