Showing posts with label VB. Show all posts
Showing posts with label VB. Show all posts

Sunday, October 6, 2019

HOW TO CREATE PATTERNS USING VB PROGRAMMING.

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


  • To Create Pattern you need to insert One Label Control's.
  • And another Control's need to insert is  One Text box Control.
  • One Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • For Output or Display of Pattern in Form we use an Print Statement. 
  • In this Example I used default names of Control. 
The Pattern is Look's Like
ABCDE
ABCDE
ABCDE
ABCDE
ABCDE

Coding of Pattern

Private Sub cmdClick_Click()
Dim n, a As Integer
n = Val(Text1.Text)
For i = 1 To n
    a = 65
    For j = 1 To n
        Print Chr(a);
        a = a + 1
    Next j
    Print
Next i
End Sub
Code Window

Design View

Output View

HOW TO CREATE PATTERNS USING VB PROGRAMMING.

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


  • To Create Pattern you need to insert One Label Control's.
  • And another Control's need to insert is  One Text box Control.
  • One Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • For Output or Display of Pattern in Form we use an Print Statement. 
  • In this Example I used default names of Control. 
The Pattern is Look's Like
A
AB
ABC
ABCD
ABCDE

Coding of Pattern

Private Sub cmdClick_Click()
Dim n, a As Integer
n = Val(Text1.Text)
For i = 1 To n
    a = 65
    For j = 1 To i
        Print Chr(a);
        a = a + 1
    Next j
    Print
Next i
End Sub
Code Window

Design View

Output View

Thursday, October 3, 2019

HOW TO CREATE PATTERNS USING VB PROGRAMMING.

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


  • To Create Pattern you need to insert One Label Control's.
  • And another Control's need to insert is  One Text box Control.
  • One Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • For Output or Display of Pattern in Form we use an Print Statement. 
  • In this Example I used default names of Control. 
The Pattern is Look's Like
11111
22222
33333
44444
55555

Coding of Pattern

Private Sub cmdClick_Click()
Dim n As Integer, i As Integer
n = Val(Text1.Text)
For i = 1 To n
    For j = 1 To n
        Print i;
    Next j
    Print
Next i
End Sub


Code Window

Design View

Output View

HOW TO CREATE PATTERNS USING VB PROGRAMMING.

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


  • To Create Pattern you need to insert One Label Control's.
  • And another Control's need to insert is  One Text box Control.
  • One Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • For Output or Display of Pattern in Form we use an Print Statement. 
  • In this Example I used default names of Control. 
The Pattern is Look's Like
1
22
333
4444
55555

Coding of Pattern

Private Sub cmdClick_Click()
Dim n As Integer, i As Integer
n = Val(Text1.Text)
For i = 1 To n
    For j = 1 To i
        Print i;
    Next j
    Print
Next i
End Sub
Code Window

Design View

Output View

Wednesday, September 18, 2019

HOW TO CALCULATE AREA OF RECTANGLE USING VB PROGRAMMING.

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


  • To Calculate Area of Rectangle 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.
  • The Second Label for Output or Display of Calculate Area of Rectangle. 
  • In this Example I used default names of Control.  
  • Also we concatenate the Strings value to show proper Output in Label Control. 

Coding of Area of Rectangle

Private Sub cmdClick_Click()
Dim l As Integer, w As Integer
Dim area As Double
l = Val(Text1.Text)
w = Val(Text2.Text)
area = l * w
Label3.Caption = "Area of Rectangle is " & area
End Sub

Code Window

Output View
Design View




Monday, September 16, 2019

HOW TO CALCULATE AREA OF TRIANGLE USING VB PROGRAMMING.

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


  • To Calculate Area of Triangle 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.
  • The Second Label for Output or Display of Calculate Area of Triangle. 
  • In this Example I used default names of Control.  
  • Also we concatenate the Strings value to show proper Output in Label Control. 

Coding of Area of Triangle

Private Sub cmdClick_Click()
Dim h As Integer, b As Integer
Dim area As Double
h = Val(Text1.Text)
b = Val(Text2.Text)
area = (0.5) * h * b
Label3.Caption = "Area of Triangle " & area
End Sub

Code Window

Output View

Design View

Monday, September 9, 2019

HOW TO CALCULATE CIRCUMFERENCE OF CIRCLE USING VB PROGRAMMING.

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


  • To Calculate Circumference of Circle you need to insert Two Label Control's.
  • And another Control's need to insert is  One Text box Control.
  • One Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • The Second Label for Output or Display of Calculate Circumference of Circle. 
  • In this Example I used default names of Control.  
  • Also we concatenate the Strings value to show proper Output in Label Control. 

Coding of Area of Circumference

Private Sub cmdClick_Click()
Dim r As Integer
Dim circum As Double
r = Val(Text1.Text)
circum = 2 * 3.14 * r
Label2.Caption = "Circumference of Circle is " & circum
End Sub
Code Window

Output View

Design View

Sunday, September 8, 2019

HOW TO CALCULATE AREA OF CIRCLE USING VB PROGRAMMING.

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


  • To Calculate Area of Circle you need to insert Two Label Control's.
  • And another Control's need to insert is  One Text box Control.
  • One Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • The Second Label for Output or Display of Calculate Area of Circle. 
  • In this Example I used default names of Control.  
  • Also we concatenate the Strings value to show proper Output in Label Control. 

Coding of Area of Circle

Private Sub cmdClick_Click()
Dim r As Integer
Dim area As Double
r = Val(Text1.Text)
area = 3.14 * r * r
Label2.Caption = "Area of Circle is " & area
End Sub
Code Window

Output View

Design View

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


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

Saturday, August 31, 2019

HOW TO CREATE AN CALCULATOR USING VB PROGRAMMING.



Hi Friends Today i will show you how you can be Create an Calculator 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.
  • Four Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • Also Placed Another Label for Output or Display of Calculation of Simple Calculator. 
  • In this Example I used default names of Control.  

Coding of Calculator

Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
    Label3.Caption = Val(Text1.Text) + Val(Text2.Text)
ElseIf Index = 1 Then
    Label3.Caption = Val(Text1.Text) - Val(Text2.Text)
ElseIf Index = 2 Then
    Label3.Caption = Val(Text1.Text) * Val(Text2.Text)
Else
    Label3.Caption = Val(Text1.Text) / Val(Text2.Text)
End If
End Sub
Code Window of Calculator
  
Output View of Calculator
Design View of Calculator