Calendar-Konstruktor
Initialisiert eine neue Instanz der Calendar-Klasse.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Syntax
'Declaration
Public Sub New
'Usage
Dim instance As New Calendar
public Calendar ()
public:
Calendar ()
public Calendar ()
public function Calendar ()
Hinweise
Mit diesem Konstruktor können Sie eine neue Instanz der Calendar-Klasse erstellen und initialisieren.
Beispiel
Im folgenden Codebeispiel wird das Erstellen und Initialisieren einer neuen Instanz der Calendar-Klasse veranschaulicht.
<%@ Page Language="VB" AutoEventWireup="True" %>
<html>
<head>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
' Create new Calendar control.
Dim calendar1 as Calendar = New Calendar
' Set Calendar properties.
calendar1.OtherMonthDayStyle.ForeColor=System.Drawing.Color.LightGray
calendar1.TitleStyle.BackColor=System.Drawing.Color.Blue
calendar1.TitleStyle.ForeColor=System.Drawing.Color.White
calendar1.DayStyle.BackColor=System.Drawing.Color.Gray
calendar1.SelectionMode=CalendarSelectionMode.DayWeekMonth
calendar1.ShowNextPrevMonth=true
' Add Calendar control to Controls collection.
Form1.Controls.Add(calendar1)
End Sub 'Page_Load
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3>Calendar Example</h3>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Create new Calendar control.
Calendar calendar1 = new Calendar();
// Set Calendar properties.
calendar1.OtherMonthDayStyle.ForeColor=System.Drawing.Color.LightGray;
calendar1.TitleStyle.BackColor=System.Drawing.Color.Blue;
calendar1.TitleStyle.ForeColor=System.Drawing.Color.White;
calendar1.DayStyle.BackColor=System.Drawing.Color.Gray;
calendar1.SelectionMode=CalendarSelectionMode.DayWeekMonth;
calendar1.ShowNextPrevMonth=true;
// Add Calendar control to Controls collection.
Form1.Controls.Add(calendar1);
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3>Calendar Example</h3>
</form>
</body>
</html>
<%@ Page Language="JScript" AutoEventWireup="True" %>
<html>
<head>
<script runat="server">
function Page_Load(sender : Object, e : EventArgs)
{
// Create new Calendar control.
var calendar1 : Calendar = new Calendar();
// Set Calendar properties.
calendar1.OtherMonthDayStyle.ForeColor=System.Drawing.Color.LightGray;
calendar1.TitleStyle.BackColor=System.Drawing.Color.Blue;
calendar1.TitleStyle.ForeColor=System.Drawing.Color.White;
calendar1.DayStyle.BackColor=System.Drawing.Color.Gray;
calendar1.SelectionMode=CalendarSelectionMode.DayWeekMonth;
calendar1.ShowNextPrevMonth=true;
// Add Calendar control to Controls collection.
Form1.Controls.Add(calendar1);
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3>Calendar Example</h3>
</form>
</body>
</html>
Plattformen
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
Calendar-Klasse
Calendar-Member
System.Web.UI.WebControls-Namespace