473,804 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get all selected items from CheckedListBox

2 New Member
Hi All,

I am using VB.NET 2005. I am using the control CheckedListBox control on my form, which is a collection of multiple check boxes. i am selecting multiple items from the collection and trying to get those selected items. for this i am using the property SelectedItems. but every time i am getting the last selected item. i tried the CheckedItems property. but this also gives the same result. i am not knowing where i am going wrong.

could any one help me in this regard.

Thanks in advance for any suggestions.

regards,
Sep 19 '07 #1
1 1884
aliasruel
73 New Member
Hi,

Here's a sample code where you can determine the checked items in your checklistbox control in vb.net (windows apps)

Dim itemsChecked As New ArrayList
Dim x As Integer
'this line is all you need
itemsChecked.Ad dRange(Me.Check edListBox1.Chec kedItems)
itemsChecked.Tr imToSize()
For x = 0 To itemsChecked.Co unt - 1
MsgBox(itemsChe cked.Item(x).To String)
Next

Best Regards,
Ruel Sucgang




Hi All,

I am using VB.NET 2005. I am using the control CheckedListBox control on my form, which is a collection of multiple check boxes. i am selecting multiple items from the collection and trying to get those selected items. for this i am using the property SelectedItems. but every time i am getting the last selected item. i tried the CheckedItems property. but this also gives the same result. i am not knowing where i am going wrong.

could any one help me in this regard.

Thanks in advance for any suggestions.

regards,
Sep 19 '07 #2

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

Similar topics

1
9862
by: Bobby | last post by:
I want to enable/disable individual items in a checkedlistbox. I have a field in a db that tells me whether the item should be enabled. I am just not sure how to disable an item in the checkedlistbox Thanks, Robert *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
6211
by: Corey Scheich | last post by:
Coming from mostly VBA to VB.NET so bare with me. I am creating a form with a CheckedListBox. I want to populate the listbox as the user types in a value. I tried to use CheckedListbox.Items = SomeCollection but I am getting a compile error saying that "Items" is a 'Read Only' Property. How should I get around this.
0
1535
by: Marcin Podle¶ny | last post by:
Hi, I need some help with my CheckedListBox. I'd like to set some of CheckedListBox items to read only. I would also like to set these items to look different than other items (i.e. they could be gray or smth.). Is this possible and how to do it? Thanks Marcin
1
1253
by: engloon | last post by:
In VB.NET, i want to create a checkedlistbox that contains some items. some of the items is checked based on some condition. if the item is checked, i don't want user to unchecked it, so i need to disable the checked item. Is this possible with the CheckedListBox control in VB.NET? Thanks.
1
3129
by: engloon | last post by:
hi guys, below is the code i wrote. but it only return the first checked item even i have 2 items checked. please help on this problem. any help would be appreciated, thanks. Dim indexchecked As Integer Dim MYSTR As String For indexchecked = 0 To checkedlistbox.Items.Count - 1 Dim drv As DataRowView = CType(checkedlistbox.SelectedItem, DataRowView)
0
1466
by: diego | last post by:
Greetings from the Philippines! I have a checkedlistbox contained in a tabpage of a tab control. i can programmatically check the items. i can see the items get checked when the tab page has focus. However, if i move to another tab page and return to the tab page with the checkedlistbox, all the checks i made are gone. The same thing happens when I manually check the items, move to another tab page, and return to the same page. i'm...
1
3121
by: ramkumar533 | last post by:
Hi all.. I am designig a form. its having a checkedlistbox control in vb.net2005 v1.2 . During the execution only one item should be checked at a moment. if one value is already selected, while we are checking the new one the previous one must be unchecked.. i hope we can do this progrmmatically. But is there any option or properties in the checkedlistbox control.. Help me in this.... Regards Ram
1
6357
by: TheDevelopers | last post by:
Hi All, I am using C#.NET 2005. I am using the control CheckedListBox control on my form, which is a collection of multiple check boxes. i am selecting multiple items from the collection and trying to get those selected items. for this i am using the property SelectedItems. but every time i am getting the last selected item. i tried the CheckedItems property. but this also gives the same result. i am not knowing where i am going wrong. ...
1
3088
by: nczimm | last post by:
CheckedListBox1.SelectedValue does not seem to have a mechanism for identifying the selected items. It just takes the first item. There doesn't seem to be a way to relate checked items to selected values. Is there a way to get the selected value for all checked items in a checkedListBox? Thanks
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.