To get the checkboxes list, you should use the CheckedListBox
control.
aspx markup:
<asp:CheckBoxList ID="CheckBoxList1" runat="server" BorderStyle="Solid" BorderWidth="1px" ></asp:CheckBoxList>
In the code-behind:
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
'' this is the most simplest example of adding items. you may use databinding etc.
CheckBoxList1.Items.Add("This is checkbox 1")
CheckBoxList1.Items.Add("This is checkbox 2")
CheckBoxList1.Items.Add("This is checkbox 3")
CheckBoxList1.Items.Add("This is checkbox 4")
CheckBoxList1.Items.Add("This is checkbox 5")
CheckBoxList1.Items.Add("This is checkbox 6")
CheckBoxList1.Items.Add("This is checkbox 7")
CheckBoxList1.Items.Add("This is checkbox 8")
CheckBoxList1.Items.Add("This is checkbox 9")
End Sub
To get the scrollbars, you should enclose the CheckedListBox
in a Panel
with ScrollBars
property set to Vertical
<asp:Panel ID="Panel1" runat="server" BorderStyle="Solid" BorderWidth="1px" ScrollBars="Vertical" Width="300px" Height="100px">
<asp:CheckBoxList ID="CheckBoxList1" runat="server" ></asp:CheckBoxList>
</asp:Panel>
This is checkbox
This is checkbox
This is checkbox
This is checkbox
This is checkbox
This is checkbox