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 して、コントロールのセルを 10 ピクセル間隔で RadioButtonList 配置する方法を示します。

<%@ 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 に設定されている場合にのみ適用されます。

テーブル内の個々のセル間の間隔を制御するには、このプロパティを使用します。 このプロパティは、垂直方向と水平方向の両方に適用されます。

適用対象

こちらもご覧ください