RadioButtonList.CellSpacing 屬性

定義

取得或設定相鄰表格儲存格之間的距離 (以像素為單位)。

public:
 virtual property int CellSpacing { int get(); void set(int value); };
[System.ComponentModel.Bindable(true)]
public virtual int CellSpacing { get; set; }
public virtual int CellSpacing { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.CellSpacing : int with get, set
member this.CellSpacing : int with get, set
Public Overridable Property CellSpacing As Integer

屬性值

相鄰表格儲存格之間的距離 (以像素為單位)。 預設值為 -1,表示這個屬性未設定。

屬性

範例

下列程式碼範例示範如何使用 CellSpacing 屬性將控制項的 RadioButtonList 儲存格分隔為 10 圖元。

<%@ Page Language="C#" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RadioButtonList.CellSpacing Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList2"
      RepeatLayout = "Table"
      CellSpacing = "10" 
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>
 
 </asp:RadioButtonList>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RadioButtonList.CellSpacing Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList2"
      RepeatLayout = "Table"
      CellSpacing = "10" 
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>
 
 </asp:RadioButtonList>
</body>
</html>

備註

只在 RepeatLayout 屬性設為 RepeatLayout.Table 時,這個屬性才適用。

使用這個屬性來控制表格中個別儲存格之間的間距。 此屬性會以垂直和水準方式套用。

適用於

另請參閱