WELLCOME

Visual Basic is a very easy and powerful programming language, a very simple coding of the software can be created with Visual Basic. I have my Blogger (http://www.vbcodebd.blogspot.com) in Visual basic 6.0 via kinds Program will discuss the code. Thanks All ..........

Sunday, February 17, 2013

Leap year Programing code vb 6 (Visual Basic Tutorial - 17)



Create a form with      2 text boxe , 1 Label , And 1 command button.


Label properties…………..
Label1 Caption- Year

Command buttons properties…………..
Command buttons 1 - Caption: Leap year or not

Add the following code to the form code module for the Formr1 _Click event:

Program code:

Private Sub Command1_Click()
Dim x, y, z, year
year = Val(Text1)
x = year Mod 4
y = year Mod 100
z = year Mod 400
If ((x = 0 And Not (y = 0)) Or z = 0) Then
Text2 = "This is a leap year"
Else
Text2 = "This is not a leap year"
End If

End Sub
 ..........................................................
.....................................................

by Md. Sayemon

4 comments: