Calendar.CellPadding プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As Calendar Dim value As Integer value = instance.CellPadding instance.CellPadding = value
/** @property */ public int get_CellPadding () /** @property */ public void set_CellPadding (int value)
セルの内容とセルの境界との間の余白の量 (ピクセル単位)。既定値は 2 です。



CellPadding プロパティを使用して、各セルに 5 ピクセルの余白を追加する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" CellPadding="5" ShowGridLines="true"/> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" CellPadding="5" ShowGridLines="true"/> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" CellPadding="5" ShowGridLines="true"/> </form> </body> </html>
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <script runat="server" > Sub Selection_Change(sender As Object, e As EventArgs) ' Set the cell padding and cell spacing for the Calendar control ' based on the values selected from the DropDownList control. Calendar1.CellPadding = CellPaddingList.SelectedIndex Calendar1.CellSpacing = CellSpacingList.SelectedIndex End Sub </script> <body> <form runat="server"> <h3> Calendar CellPadding and CellSpacing Example </h3> Select the cell padding and cell spacing values. <br><br> <asp:Calendar id="Calendar1" ShowGridLines="True" ShowTitle="True" runat="server"/> <br><br> <table cellpadding="5"> <tr> <td> Cell padding: </td> <td> Cell spacing: </td> </tr> <tr> <td> <asp:DropDownList id="CellPaddingList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem> 0 </asp:ListItem> <asp:ListItem> 1 </asp:ListItem> <asp:ListItem Selected="True"> 2 </asp:ListItem> <asp:ListItem> 3 </asp:ListItem> <asp:ListItem> 4 </asp:ListItem> <asp:ListItem> 5 </asp:ListItem> </asp:DropDownList> </td> <td> <asp:DropDownList id="CellSpacingList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem Selected="True"> 0 </asp:ListItem> <asp:ListItem> 1 </asp:ListItem> <asp:ListItem> 2 </asp:ListItem> <asp:ListItem> 3 </asp:ListItem> <asp:ListItem> 4 </asp:ListItem> <asp:ListItem> 5 </asp:ListItem> </asp:DropDownList> </td> </tr> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <script runat="server" > void Selection_Change(Object sender, EventArgs e) { // Set the cell padding and cell spacing for the Calendar control // based on the values selected from the DropDownList control. Calendar1.CellPadding = CellPaddingList.SelectedIndex; Calendar1.CellSpacing = CellSpacingList.SelectedIndex; } </script> <body> <form runat="server"> <h3> Calendar CellPadding and CellSpacing Example </h3> Select the cell padding and cell spacing values. <br><br> <asp:Calendar id="Calendar1" ShowGridLines="True" ShowTitle="True" runat="server"/> <br><br> <table cellpadding="5"> <tr> <td> Cell padding: </td> <td> Cell spacing: </td> </tr> <tr> <td> <asp:DropDownList id="CellPaddingList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem> 0 </asp:ListItem> <asp:ListItem> 1 </asp:ListItem> <asp:ListItem Selected="True"> 2 </asp:ListItem> <asp:ListItem> 3 </asp:ListItem> <asp:ListItem> 4 </asp:ListItem> <asp:ListItem> 5 </asp:ListItem> </asp:DropDownList> </td> <td> <asp:DropDownList id="CellSpacingList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem Selected="True"> 0 </asp:ListItem> <asp:ListItem> 1 </asp:ListItem> <asp:ListItem> 2 </asp:ListItem> <asp:ListItem> 3 </asp:ListItem> <asp:ListItem> 4 </asp:ListItem> <asp:ListItem> 5 </asp:ListItem> </asp:DropDownList> </td> </tr> </form> </body> </html>

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からCalendar.CellPadding プロパティを検索する場合は、下記のリンクをクリックしてください。

- Calendar.CellPadding プロパティのページへのリンク