Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
限制asp.net中CheckedListBox中显示的项目数_Asp.net_Webforms_Checkboxlist - Fatal编程技术网

限制asp.net中CheckedListBox中显示的项目数

限制asp.net中CheckedListBox中显示的项目数,asp.net,webforms,checkboxlist,Asp.net,Webforms,Checkboxlist,我在asp.net web表单页中有一个checkedlistbox,如下所示: <asp:CheckBoxList ID="TagListCheckBox" runat="server" Height="100px" Width = "300px" style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left"> </asp:CheckBoxList> 但是列表框的高度会

我在asp.net web表单页中有一个checkedlistbox,如下所示:

<asp:CheckBoxList ID="TagListCheckBox" runat="server" Height="100px" Width = "300px" 
style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left">
</asp:CheckBoxList>

但是列表框的高度会随着添加的项目数的增加而增加。我想限制要显示的项目数,并在列表框中添加一个滚动按钮或其他内容。我该怎么做?

尝试在控件周围放置一个div,这应该可以做到:

<div style="width:200px; height:100px; overflow:auto;">
  <asp:CheckBoxList ID="TagListCheckBox" runat="server" Width="300px" 
  style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left">
  </asp:CheckBoxList>
</div>


试着在你的控件周围放置一个div,这应该可以做到:

<div style="width:200px; height:100px; overflow:auto;">
  <asp:CheckBoxList ID="TagListCheckBox" runat="server" Width="300px" 
  style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left">
  </asp:CheckBoxList>
</div>

可能的重复可能的重复