473,573 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FindString CheckListBox

Hello
I have a little problem i have a checkedlistbox with
several repeated items.

The code below only selects the first ocurrence

While reader.Read
For i = 0 To Me.CheckedListB ox1.Items.Count - 1
Me.CheckedListB ox1.SetItemChec ked
(Me.CheckedList Box1.FindString (reader.GetStri ng(0)), True)
Next
End While
reader.Close()

Any suggestion to select all of them?
Thanks

Jorge Cavalheiro

Nov 20 '05 #1
2 2063
Cor
Hi Jorge,

I never used the checked listbox, and I know you know enough about this to
find it yourself if you see what you did probably wrong.
The code below only selects the first ocurrence

While reader.Read
For i = 0 To Me.CheckedListB ox1.Items.Count - 1
Me.CheckedListB ox1.SetItemChec ked
Which one you think will be checked except the first, there is not an
indexer?

I think it has to be something as

me.checkedlistb ox1.items(i).se titemchecked (I do not know if that is the
right one but that you can see in your intelisense I think.

:-)
(Me.CheckedList Box1.FindString (reader.GetStri ng(0)), True)
Next
End While
reader.Close()

Cor
Nov 20 '05 #2
Hi Cor
Good point got to work, thanks
Jorge
-----Original Message-----
Hi Jorge,

I never used the checked listbox, and I know you know enough about this tofind it yourself if you see what you did probably wrong.
The code below only selects the first ocurrence

While reader.Read
For i = 0 To Me.CheckedListB ox1.Items.Count - 1
Me.CheckedListB ox1.SetItemChec ked
Which one you think will be checked except the first,

there is not anindexer?

I think it has to be something as

me.checkedlist box1.items(i).s etitemchecked (I do not know if that is theright one but that you can see in your intelisense I think.
:-)
(Me.CheckedList Box1.FindString (reader.GetStri ng(0)), True) Next
End While
reader.Close()

Cor
.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1068
by: Rene Aguirre | last post by:
Hello everybody, I had this problem using the FindString funcion of a wxChoice object on wxPython: * I have Windows 98 * I read a text file edited on a Japanese computer, but only uses 'english' characters. * From the file I loaded some strings in some wxChoice object. * Later when I wanted to find an string using 'FindString' I never...
5
2954
by: Bernie Yaeger | last post by:
Is there any way to get a listbox or a checklistbox behave in an autocomplete manner, such that given 'two', 'three', 'water', 'them' would bring the selection to 'two' (not 'water') when I key in 'tw'? I know using various autocomplete routines I can do this with a combobox, but I need to do it with either a listbox or a checklistbox. ...
17
3098
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP) Me.lboxRP.SetSelected(newRPindex, True) When the last line executes, I get an error message:
3
9293
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data, checkbox's and icons are displayed as they are meant to be. My problem is this, I am trying to achieve the same results as I get with CheckListBox(s),...
1
7349
by: comic_rage | last post by:
Hi, I created a checkListBox to allow the user to select and place a check next to multiple items in the GUI. I would like to add a 2 column where the first column show the description of the item and the second column show the version. How can I create 2 columns with a checkListBox? How can I add a header above the 2 columns to show...
2
16636
by: Mike Kim | last post by:
hi all, i have a checklistbox populated with about 50 items from database. and on the same form, i added to button to do the following. if you click this button, i want to have all items in the checklistbox to be checked i want to have all items in the checklistbox to be unchecked. thanks advance, folks.
0
3104
by: Ville Mattila | last post by:
Dear readers, I've some problems with the data binding of the checklistbox control. I'm using it with user preferences that are stored in a XML File. Information from the file is fetched with SelectSingleNode and XPath. The checklistbox list values and display texts are loaded from a datatable. I've managed to do that with the DataSource,...
1
1927
by: obrienkev | last post by:
Hi, I want to mark the CheckListBox items as Checked based on a database query. So the CheckListBox items should be checked if each item matches fundsAffected field from the below query... SELECT DISTINCT fundsAffected as myFunds FROM myFunds AS f INNER JOIN myDetails AS d ON d.corpID = f.corpID WHERE d.securityID = securityID
3
3379
by: khalidjan9 | last post by:
I have data in an arraylist and i want to add data to checklist box on runtime and i also want to display a textbox besides it so that i get the comments example : checklistbox "text" textbox checklistbox "text" textbox checklistbox "text" textbox checklistbox "text" textbox checklistbox "text" textbox can any 1...
0
7705
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8032
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6424
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...
1
5601
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...
0
5294
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...
0
3734
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...
1
2223
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
1
1310
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1044
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...

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.