Wednesday, September 4, 2019

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


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
Code Window

Output View

Design View





No comments:

Post a Comment