RadioButtonList.TextAlign プロパティ

定義

グループ内のオプション ボタンのテキストの配置を取得または設定します。

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

プロパティ値

TextAlign 値のいずれか 1 つ。 既定値は、Right です。

属性

例外

オプション ボタンに関連付けられるラベル テキストの配置は、TextAlign 値ではありません。

次のコード例では、 プロパティを TextAlign 使用して、コントロールの左側にあるラジオ ボタンに関連付けられているテキストを表示する方法を RadioButtonList 示します。

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

<asp:RadioButtonList id="RadioButtonList1"
      RepeatColumns = "2" 
      RepeatDirection="Vertical" 
      RepeatLayout="Table"  
      TextAlign="Left"  
      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>

注釈

ラジオ ボタンに関連付けられているテキストを左または右に表示するかどうかを指定するには、このプロパティを使用します。 このプロパティが に TextAlign.Right設定されている場合、テキストはラジオ ボタンの右側に表示されます。 このプロパティが に TextAlign.Left設定されている場合、テキストはラジオ ボタンの左側に表示されます。

適用対象

こちらもご覧ください