Hi Friends Today i will show you how you can be Calculate Subtraction in VB(Visual Basic 6.0)
To Make an Subtraction you need to insert Two Label Control's.
And another Control's need to insert is Two Text box Control.
One Command button is placed to the form.
As Shown in Picture Arrange it.
Also Placed Another Label for Output or Display of Calculation of Subtraction.
In this Example I used default names of Control.
Also we concatenate the Strings value to show proper Output in Label Control.
Coding of Subtraction
Private Sub cmdClick_Click()
Dim n1 As Integer, n2 As Integer, sb As Integer
n1 = Val(Text1.Text)
n2 = Val(Text2.Text)
sb = n1 - n2
lblOutput.Caption = "Subtraction is " & sb
End Sub
Hi Friends Today i will show you how you can be Calculate Addition in VB(Visual Basic 6.0)
To Make an Addition you need to insert Two Label Control's.
And another Control's need to insert is Two Text box Control.
One Command button is placed to the form.
As Shown in Picture Arrange it.
Also Placed Another Label for Output or Display of Calculation of Addition.
In this Example I used default names of Control.
Also we concatenate the Strings value to show proper Output in Label Control.
Coding of Addition
Private Sub cmdClick_Click()
Dim n1 As Integer, n2 As Integer, add As Integer
n1 = Val(Text1.Text)
n2 = Val(Text2.Text)
add = n1 + n2
lblOutput.Caption = "Addition is " & add
End Sub
Hi Friends Today i will show you how you can be Calculate Swap in VB(Visual Basic 6.0)
You need to insert Two Label Control's.
And another Control's need to insert is Two Text box Control.
One Command button is placed to the form.
As Shown in Picture Arrange it.
Also Placed Another Label for Output or Display for Swapping Of Number .
In this Example I used default names of Control.
Here We Use an Function(vbCrLf) which is used to separate line Ok.
Also we concatenate the Strings value to show proper Output in Label Control.
Coding of Swapping Of Number
Private Sub cmdClick_Click()
Dim n1 As Integer, n2 As Integer, temp As Integer
n1 = Val(Text1.Text)
n2 = Val(Text2.Text)
temp = n1
n1 = n2
n2 = temp
lblOutput.Caption = "First Number is " & n1 & vbCrLf & "Second Number is " & n2
End Sub
Hi Friends Today i will show you how you can be Calculate Percentage in VB(Visual Basic 6.0)
To Make An Calculator you need to insert Two Label Control's.
And another Control's need to insert is Two Text box Control.
One Command button is placed to the form.
As Shown in Picture Arrange it.
Also Placed Another Label for Output or Display of Calculation of Percentages.
In this Example I used default names of Control.
Coding of Percentages
Private Sub cmdClick_Click()
Dim obt As Integer, tol As Integer
Dim per As Double
obt = Val(txtOtd.Text)
tol = Val(txtTol.Text)
per = obt * 100 / tol
Label3.Caption = "Percentage are " & per
End Sub