单侧的单选按钮文本

时间:2011-10-14 12:48:04

标签: asp.net c#-4.0

我在我的应用程序中使用单选按钮是否有任何可能的方法将文本从左侧移到右侧

1 个答案:

答案 0 :(得分:5)

TextAlign属性设置为它所属的列表中的“右”。

见这里:http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobuttonlist.textalign.aspx

示例(在VS中使用标准WebApplication并在default.aspx中包含以下内容):

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

The Result

将TextAlign设置为Left的结果是:

enter image description here

相关问题