vb.net checkbox label position

懵懂的女人 提交于 2020-01-03 08:52:43

问题


Is there a way to put the checkbox to the right of the label on an asp checkbox?

This code by default places the checkbox then the label...

<asp:CheckBox CssClass="myCheckbox" ID="CBmyCheck" runat="server" Text="My label"></asp:CheckBox>

回答1:


One simple solution is create two seperate objects, one checkbox and one label. The checkbox label should be set to "" (that is nothing). The label should be set to "My Label". Place them where you want, in addition, first add the label and then place the checkmark to the right of it.

Another thing you can try is to set the TextAlign property of the checkbox:

TextAlign="Left"




回答2:


<asp:CheckBox TextAlign="left|right" runat="server"  />

Eg:
    <asp:CheckBox TextAlign="right" runat="server" Text = "I am right align />

    <asp:CheckBox TextAlign="left" runat="server" Text = "I am left align />



回答3:


I did this in Vb.net with

CheckBox1.RightToLeft = Windows.Forms.RightToLeft.Yes


来源:https://stackoverflow.com/questions/4658434/vb-net-checkbox-label-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!