473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Check Box List

How can i use CheckBox LISt control in vb.net
Mar 12 '07 #1
3 1211
More Information :
I have a table in database that stores the intrerst of user like Cricket,basketball,snooker etc. now this interests I have to show with checkbox on a page that a user can select multiple interestes so for the same how can i use checkbox list or any other way to do his

PLease help me....
Mar 12 '07 #2
shweta123
692 Expert 512MB
Hi,

Here is the usage of CheckedListBox,

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
''''''''''Adds the item
''''''''''''''''''''''Here you can also take database field

CheckedListBox1.Items.Add("Cricket")
CheckedListBox1.Items.Add("Snooker")



''''''''''Removes the item
CheckedListBox1.Items.Remove(CheckedListBox1.Items .Item(0))
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'''''''''''''''''''Gets checked Item Collection
Dim checked_items As CheckedListBox.CheckedItemCollection = CheckedListBox1.CheckedItems
For Each checked_item As Object In checked_items
MsgBox(checked_item)
Next
End Sub
Mar 12 '07 #3
Hi,

Here is the usage of CheckedListBox,

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
''''''''''Adds the item
''''''''''''''''''''''Here you can also take database field

CheckedListBox1.Items.Add("Cricket")
CheckedListBox1.Items.Add("Snooker")



''''''''''Removes the item
CheckedListBox1.Items.Remove(CheckedListBox1.Items .Item(0))
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'''''''''''''''''''Gets checked Item Collection
Dim checked_items As CheckedListBox.CheckedItemCollection = CheckedListBox1.CheckedItems
For Each checked_item As Object In checked_items
MsgBox(checked_item)
Next
End Sub
Thanks Shewta but i am working on web application
Mar 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Alex82 | last post by:
I can't use it....for example i have to create a column that accept values between 1 to 120...i can't enumerate all of them....or i have to accept a value different from NULL if an other column has...
8
by: pw | last post by:
Hi, I need to create a function in javascript to check or uncheck all checkboxes in a form. From what I understand, I can do this either by specifying the name of the check box fields such as: ...
0
by: H. Scott Buckwalter | last post by:
ASP.NET: I want to control the color of the text for a check box control in JavaScript on the client. I am able to do this by surrounding the check box in a SPAN tag. I then color the span and...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
1
by: Spectre1337 | last post by:
Hello, it seems like the check constraint validation of MS SQL Server Management Studio express is horribly, horribly broken. Either that or I'm using it wrong. I hope it's the latter. I'm...
3
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
I've a multiview with 3 views. on view 2 the user is presented with a check box list (items from database) at view 3 the user can review their selections and, either post to the database or go back...
5
by: Andrew Meador | last post by:
I have a form (Change Card List by Status) with a check box (cboNOT) and a list box (lstStatus). There is an Open Report button that opens a report (Report - Change Card List) which uses a query...
6
by: dudeja.rajat | last post by:
Hi, How to check if something is a list or a dictionary or just a string? Eg: for item in self.__libVerDict.itervalues(): self.cbAnalysisLibVersion(END, item) where __libVerDict is a...
5
by: =?Utf-8?B?THVpZ2k=?= | last post by:
Hi all, having a List<stringand Dictionary<int, stringhow can I check that every string in the list is also in the Dictionary (and viceversa)? (and raise an exception when not). Thanks in...
1
by: ajitmalkar | last post by:
I have a "Select All" Check Box and Check Box List in columns of Repeater Control. I want to select all check box list check boxes on click of check box in individual row. How to achive this ? Any...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.