简体   繁体   English

vb.net复选框标签位置

[英]vb.net checkbox label position

Is there a way to put the checkbox to the right of the label on an asp checkbox? 有没有办法将复选框放在asp复选框上的标签右侧?

This code by default places the checkbox then the label... 默认情况下,此代码将复选框放置标签...

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

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属性:

TextAlign="Left"

<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 />

我在Vb.net中这样做了

CheckBox1.RightToLeft = Windows.Forms.RightToLeft.Yes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM