Saturday, September 7, 2019

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

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


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

Coding of Multiplication

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

Output View

Design View

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 




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





Tuesday, September 3, 2019

HOW TO SWAP TWO NUMBER'S USING VB PROGRAMMING.

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

Code Window

Output View

Design View



HOW TO CALCULATE PERCENTAGE USING VB PROGRAMMING.

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
  

Code Window

Output View

Design View