Thursday, July 8, 2010

My Visual Basic 6.0 (Chapter 01-Extra_Ex1)


+Extra-Exercise 1:
In this exercises you will see how to make your own sample calendar with current time and date depend on your machine.........


 +Setting Properties:
-Form:
Form:
Name: frmCalendar
BorderStyle: 1-Fixed Single
Caption: My Calendar

 -Labels:
Label 1:
Name: lblDay
Caption: Day

Label 2:
Name: lblTime
Caption:Time

Label 3:
Name: lblMonth
Caption:Month

Label 5:
Name: lblNumber
Caption:Number

 Label 4:
Name: lblYear
Caption:Year

 -Timer:
Timer:
Name: TimeDisplay
Interval: 250
 
+Attaching Codes:
Private Sub TimeDisplay_Timer()
Dim Today As Variant
Today = Now
lblDay.Caption = Format(Today, "dddd")
lblMonth.Caption = Format(Today, "mmmm")
lblYear.Caption = Format(Today, "yyyy")
lblNumber.Caption = Format(Today, "d")
lblTime.Caption = Format(Today, "hh:mm:ss AMPM")
End Sub

*I use Interval = 250 , it's mean that my code will run after 0.25Sec because 1000millisecond= 1Second and the value in Interval is calculated as millisecond.













 

No comments:

Post a Comment