Freelance Writing Jobs | Today's Articles | Sign In

 
Browse Sections

MS Calendar Control


a different, synchronized form. You can use the properties associated with a control to display or retrieve data.

The most common example of using Calendar control is given below. First of of, one should insert the Control to the document:

<html>
<body onLoad="setDate()">
<object id="Mscal" classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02"
width="372" height="279">
<param name="BackColor" value="12632256">
<param name="Year" value="2001">
<param name="Month" value="11"
param name="Day" value="12">
</object>

Then, let's write the custom subroutine which will run when the document is loaded:

<script language="VBScript"> 
<!-- 
Sub setDate() 
     Dim dtToday 
     dtToday = Date() 
     Calendar1.Day      = Day(dtToday) 
     Calendar1.Month = Month(dtToday) 
     Calendar1.Year      = Year(dtToday)
end Sub 
rem --> 
</script> 

In the above HTML/VBScript code snippet the date displayed by the calendar control is set to today's date using the native Date object. Notice that the ActiveX Object/control can be addressed as objectName.propertyName you can even invoke methods of an ActiveX Object/control.

The copyright of the article MS Calendar Control in VB Script is owned by Maxim Karetnikov. Permission to republish MS Calendar Control in print or online must be granted by the author in writing.

Go To Page: 1 2

Articles in this Topic    Discussions in this Topic