Calendar.CellSpacing 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
셀 사이의 여백 크기를 가져오거나 설정합니다.
public:
property int CellSpacing { int get(); void set(int value); };
[System.ComponentModel.Bindable(true)]
public int CellSpacing { get; set; }
public int CellSpacing { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.CellSpacing : int with get, set
member this.CellSpacing : int with get, set
Public Property CellSpacing As Integer
속성 값
셀 사이의 여백 크기(픽셀)입니다. 기본값은 0
입니다.
- 특성
예외
지정한 셀 안쪽 여백이 -1보다 작은 경우
예제
다음 코드 예제에서는 셀 간격 5 픽셀 속성을 사용 CellSpacing 하는 방법을 보여 줍니다.
<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Calendar Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>Calendar Example</h3>
<asp:Calendar id="calendar1" runat="server"
CellSpacing="5"
ShowGridLines="true"/>
</form>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Calendar Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>Calendar Example</h3>
<asp:Calendar id="calendar1" runat="server"
CellSpacing="5"
ShowGridLines="true"/>
</form>
</body>
</html>
<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml" >
<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>
<head runat="server">
<title> Calendar CellPadding and CellSpacing Example </title>
</head>
<body>
<form id="form1" 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>
</table>
</form>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<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>
<head runat="server">
<title> Calendar CellPadding and CellSpacing Example </title>
</head>
<body>
<form id="form1" 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>
</table>
</form>
</body>
</html>
설명
달력의 개별 셀 사이의 간격을 제어하려면 이 속성을 사용합니다. 이 간격이 세로 및 가로로 적용 됩니다.
참고
이 속성을 설정하면 -1
이 속성이 렌더링된 테이블에서 설정되지 않음을 나타냅니다.