Saturday, September 7, 2019

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


Hi Friends Today i will show you how you can be Calculate Division in VB(Visual Basic 6.0)


  • To Make an Division 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 Division. 
  • In this Example I used default names of Control.  
  • Also we concatenate the Strings value to show proper Output in Label Control. 

Coding of Division

Private Sub cmdClick_Click()
Dim n1 As Integer, n2 As Integer, div As Integer
n1 = Val(Text1.Text)
n2 = Val(Text2.Text)
div = n1 / n2
lblOutput.Caption = "Division is " & div
End Sub
Code Window

Output View
Design View


1 comment: