RadioButtonList.CellSpacing 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置相邻表格单元格之间的距离(以像素为单位)。
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
时才应用此属性。
使用此属性可控制表格中各个单元格之间的间距。 此属性同时在垂直和水平方向应用。
适用于
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈