Vous êtes sur la page 1sur 2

August 1, 2012

[PROGRAM NUMBER 1: SIMPLE CALCULATOR]

Program Task: To Demonstrate The Functions Of A Simple Calculator

Dim n1 As Integer Dim n2 As Integer Dim result As Integer Private Sub Command3_Click() n1 = Text1.Text n2 = Text2.Text result = n1 + n2 Text3.Text = Val(result) End Sub Private Sub Command4_Click() n1 = Text1.Text n2 = Text2.Text result = n1 - n2 Text3.Text = Val(result) End Sub Private Sub Command5_Click() n1 = Text1.Text n2 = Text2.Text result = n1 * n2 Text3.Text = Val(result) End Sub Private Sub Command6_Click() n1 = Text1.Text n2 = Text2.Text result = n1 / n2 Text3.Text = Val(result) End Sub Private Sub Command7_Click() Unload Me End Sub Private Sub Command8_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub

Syeda Narjis Fatima Zaidi

Page 1

August 1, 2012

[PROGRAM NUMBER 1: SIMPLE CALCULATOR]

GUI:

Syeda Narjis Fatima Zaidi

Page 2

Vous aimerez peut-être aussi