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 时才应用此属性。

使用此属性可控制表格中各个单元格之间的间距。 此属性同时在垂直和水平方向应用。

适用于

另请参阅