473,568 Members | 2,762 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 2061
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
1067
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
3094
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
16635
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
3103
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
3378
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
7693
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...
0
7604
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
7916
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
8117
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5217
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
3651
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
2101
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
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.