asp.net.ph

Calendar Constructor

System.Web.UI.WebControls Namespace   Calendar Class


Initializes a new instance of the Calendar class.

[ VB ]
Public Sub New ( )

[ C# ]
public Calendar ( );

[ C++ ]
public: Calendar ( );

[ JScript ]
public function Calendar ( );

Remarks

Use this constructor to create and initialize a new instance of the Calendar class.

Example

The following example demonstrates how to create and initialize a new instance of the Calendar class.

<%@ Page Language = "C#" %>

<html>
<head>
   <script runat = "server">
      void Page_Load ( Object src, EventArgs e ) {
         // create new Calendar control.
         Calendar myCalendar=new Calendar ( );

         // set Calendar properties.
         myCalendar.OtherMonthDayStyle.ForeColor=System.Drawing.Color.Gray;
         myCalendar.TitleStyle.BackColor=System.Drawing.Color.Blue;
         myCalendar.TitleStyle.ForeColor=System.Drawing.Color.White;
         myCalendar.DayStyle.BackColor=System.Drawing.Color.Gray;
         myCalendar.SelectionMode=CalendarSelectionMode.DayWeekMonth;
         myCalendar.ShowNextPrevMonth=true;

         // add Calendar control to Controls collection.
         Form1.Controls.Add ( myCalendar );
      }
   </script>
</head>
<body>

   <form id = "Form1" runat = "server">

      <h3>Calendar Example</h3>

   </form>

</body>
</html>
  C# VB

See Also

Calendar Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph