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

Одно из значений перечисления TextAlign. Значение по умолчанию — 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значение, текст отображается слева от переключателя.

Применяется к

См. также раздел