Friday, September 6, 2019

HOW TO CALCULATE SUBTRACTION TWO NUMBER'S USING VB PROGRAMMING.

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
Code Window
Output View
Design View 




No comments:

Post a Comment