【问题标题】:one item 2 lines checkbox list c#一项 2 行复选框列表 c#
【发布时间】:2016-06-07 13:58:25
【问题描述】:

我想在字符串集合编辑器中有一个复选框项目列表,但其中一个项目太长,所以我希望它放在换行符中。

我的清单是这样的
*无袖,露背,管,露肩,露背
*细肩带、深V领口等
*紧身衣、衬衫和连衣裙
*沙滩服、上衣不遮住身体中部
*膝盖中部以上两 (2) 英寸以上的短裙和裙子

但我想成为这样的人

*无袖、露背、管状、露肩、露背
*细肩带、深V领口等
*紧身衣、衬衫和连衣裙
*沙滩服、上衣不遮住身体中部
*超过两 (2) 英寸的短裙和裙子
膝盖中间以上

我希望最后一项在 2 行中,但仅计为一项,因为我知道如果您将其放在新行中,它将计为另一项。谢谢。 :D

【问题讨论】:

标签: c#


【解决方案1】:

假设您使用的是 asp.net 网络表单。我只检查了您示例中较大的文本。检查下面的 html 代码供您参考。

[![<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

<style type="text/css" media="all">
    .checkboxlist_nowrap tr td label
    {
        white-space:nowrap;
        overflow:hidden;
    }
</style> 
</head>

<body>
    <form id="form1" runat="server">
    <div style="border: solid 1px blue; width:300px">
    <asp:CheckBoxList ID="CheckBoxList2" runat="server">
        <asp:ListItem Value="0" Text="line 0"></asp:ListItem>
        <asp:ListItem Value="1" Text="*Short dresses and skirts that are more than two(2) inches above the middle of the knee "></asp:ListItem>
    </asp:CheckBoxList>
</div> 
    </form>
</body>
</html>][1]][1]

【讨论】:

  • 你真的知道他是否在使用 ASP.net 吗?
  • @NahuelIanni,不,但这是我的假设。无论如何感谢您的指点,我会更新我的答案:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多