Page

How to use Calendar ApplyStyle method in asp.net

<%@ Page Language="C#" AutoEventWireup="true" %>  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<script runat="server">  
    protected void Button1_Click(object sender, System.EventArgs e)  
    {  
        Style orchidStyle = new Style();  
        orchidStyle.BackColor = System.Drawing.Color.DarkOrchid;  
        orchidStyle.ForeColor = System.Drawing.Color.Snow;  
        orchidStyle.BorderColor = System.Drawing.Color.Orchid;  
        orchidStyle.Width = 700;  
        orchidStyle.Font.Name = "Courier New";  
        orchidStyle.Font.Italic = false;  
        orchidStyle.Font.Size = FontUnit.Large;  
        Calendar1.ApplyStyle(orchidStyle);  
    }  
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>How to use Calendar ApplyStyle method in asp.net</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2 style="color:MidnightBlue; font-style:italic;">  
            How to use Calendar ApplyStyle method in asp.net  
        </h2>  
        <hr width="550" align="left" color="SkyBlue"/>  
        <br />  
        <asp:Calendar  
            ID="Calendar1"   
            runat="server"  
            NextPrevFormat="ShortMonth"  
            SelectionMode="DayWeekMonth"  
            SelectMonthText="Month"  
            SelectWeekText="Week"  
            DayNameFormat="Full"  
            ForeColor="Snow"  
            BackColor="Crimson"  
            BorderColor="IndianRed"  
            ShowGridLines="true"  
            TitleStyle-Height="35"  
            TitleStyle-BackColor="MidnightBlue"  
            SelectedDayStyle-BackColor="Green"  
            SelectedDayStyle-BorderColor="SeaGreen"  
            >  
        </asp:Calendar>  
        <br />  
        <asp:Button   
            ID="Button1"  
            runat="server"  
            OnClick="Button1_Click"  
            Text="Calendar ApplyStyle"  
            Height="45"  
            Font-Bold="true"  
            ForeColor="DodgerBlue"  
            />  
    </div>  
    </form>  
</body>  
</html>  

No comments:

Post a Comment