Note: Use MDI form.
Dim n1,n2, result As Integer
Dim n3, n4, res1 As Integer
Private Sub cmdClick1_Click()
nl = CInt(txtnum1.Text)
n2 = CInt (txtnum2.Text)
If MDIForm1.opr = "A" Then
frmCalculate.fraArith.Caption = "ADDITION"
result = n1 + n2 txtResult1.Text = result
End If
If MDIForm1.opr = "S" Then
frmCalculate.fraArith.Caption = "SUBTRACTION" result = n1 - n2
txtResult1.Text = result
End If
If MDIForm1.opr = "M" Then
frmCalculate.fraArith.Caption = "MULTIPLICATION"
result = n1 * n2
txtResult1. Text = result
End If
If MDIForm1.opr = "D" Then
frmCalculate.fraArith.Caption = "DIVISION"
result = n1/n2
txtResult1.Text = result
End If
End Sub
Private Sub Command2_Click()
Unload Me
MDIForm1.Show
End Sub
Private Sub cmdClick2_Click()
n4 = CDb1 (Text 4. Text)
n3 = CDb1 (n4)
If MDIForm1. opr = "ST" Then
A = (n3 * 180)/360
res1 = Sin (A)
txtResult2.Text = res1
End If
If MDIForm1.opr = "C" Then
frmCalculate.fraTrig.Caption = "COS OF ANGLE"
res1 = Cos (n3)
txtResult2.Text = res1
End If
If MDIForm1.opr = "T" Then
frmCalculate.fraTrig.Caption = "TAN OF ANGLE"
res1 = Tan(n3)
txtResult2.Text = res1
End If
End Sub
Private Sub Command4_Click()
Unload Me
MDIForm1.Show
End Sub
Private Sub Form_Resize()
Frame1.Left = (Me.Width - Frame1.Width)/ 2 - 50
Frame1.Top = (Me.Height - Frame1.Height)/ 2 - 230
End Sub
No comments:
Post a Comment