0% found this document useful (0 votes)
401 views

10 Project On Visual Basic 6.0 2

The document contains 6 sections describing Visual Basic programs with the following functions: 1) A welcome message program that changes text and background colors. 2) A program that determines if a number is odd or even. 3) A program that determines if a year is a leap year. 4) A program that calculates the factorial of a number. 5) A program that displays the current date and time in a calendar-like window. 6) A simple calculation program with commands for addition, subtraction, multiplication, and division.

Uploaded by

Sanny Mondal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
401 views

10 Project On Visual Basic 6.0 2

The document contains 6 sections describing Visual Basic programs with the following functions: 1) A welcome message program that changes text and background colors. 2) A program that determines if a number is odd or even. 3) A program that determines if a year is a leap year. 4) A program that calculates the factorial of a number. 5) A program that displays the current date and time in a calendar-like window. 6) A simple calculation program with commands for addition, subtraction, multiplication, and division.

Uploaded by

Sanny Mondal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1. First Project on Visual Basic 6.

0 (Welcome): -
 Command1
Private Sub Command1_Click()
Text1.Text = "Welcome to KJNNYCC"
Text1.BackColor = vbYellow
Text1.ForeColor = vbRed
End Sub
 Command2
Private Sub Command2_Click()
Text1.Text = ""
Text1.BackColor = vbWhite
End Sub
 Command3
Private Sub Command3_Click()
End
End Sub

2. Create a Programme to calculate Odd and Even: -


 Command1
Private Sub Command1_Click()
DimaAs String
a = Text1.Text
If a Mod 2 > 0 Then
Label2.Caption = "This Number is Odd"
Else
Label2.Caption ="This Number is Even"
End If
End Sub
 Command2
Private Sub Command2_Click()
Text1.Text=""
Label2.Caption=""
End Sub
 Command3
Private Sub Command3_Click()
End
End Sub
3. Create a Programme to calculate Leap Year: -
 Command1
Private Sub Command1_Click()
Dim a As String
a = Text1.Text
If a Mod 4 > 0 And a Mod 400 > 0 Then
Label2.Caption ="This is Not Leap Year"
Else
Label2.Caption = "This is Leap Year"
End If
End Sub
 Command2
Private Sub Command2_Click()
Text1.Text=""
Label2.Caption=""
End Sub
 Command3
Private Sub Command3_Click()
End
End Sub

4. Create aProgramme to Calculate Factorial Number : -


 Command1
Private Sub Command1_Click()
Dim a, b, c As Integer
a = Val(Text1.Text)
b=1
For c = 1 To a
b=b*c
Next c
Text2.Text = b
Text1.Enabled = False
End Sub
 Command2
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.Enabled = True
End Sub
 Command3
Private Sub Command3_Click()
End
End Sub

5. Create a Programme to View Calendar/Time Display: -

Design a window that displays the current month, day, and year.
Also, display thecurrent time, updating it every second (look into the
Timercontrol). Make the windowlook something like a calendarpage.
Play with object properties to make it pretty.
Private Sub Timer1()
Dim Today As Variant
Today = Now
Label1.Caption = Format(Today, "dddd")
Label5.Caption = Format(Today, "mmmm")
Label3.Caption = Format(Today, "yyyy")
Label4.Caption = Format(Today, "d")
Label2.Caption = Format(Today, "h:mm:ss ampm")
End Sub

6. Write a program in vb to creat a simple calculation


Coding of command 1:
Text3.text=val(text1.text)+val(text2.text)
Coding of command 2 :

Text3.text=val(text1.text)-val(text2.text)

Coding of command 3 :

Text3.text=val(text1.text)*val(text2.text)

Coding of command 4:

Text3.text=val(text1.text)/val(text2.text)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy