473,388 Members | 1,400 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,388 software developers and data experts.

Problem checking checkedlistbox

I've some problem checking items in a checkedlistbox by code:

For jj As Int32 = 0 To cbTimeOptions.Items.Count - 1

' cut: logic to set maycheck variable

cbTimeOptions.SetItemChecked(jj, maycheck )

Next

I've verified, dubbubg code, that after this for..next, cbTimeOptions has
two items checked. I've also verified, handling itemCheck event, that no
other code is changing this option after the for.

But my control hasn't item checked. Where is the error? How can I make other
useful tests?

thanks


Nov 20 '05 #1
3 1189
* "Trapulo" <no**********@qui.it> scripsit:
I've some problem checking items in a checkedlistbox by code:

For jj As Int32 = 0 To cbTimeOptions.Items.Count - 1

' cut: logic to set maycheck variable

cbTimeOptions.SetItemChecked(jj, maycheck )

Next

I've verified, dubbubg code, that after this for..next, cbTimeOptions has
two items checked. I've also verified, handling itemCheck event, that no
other code is changing this option after the for.

But my control hasn't item checked. Where is the error? How can I make other
useful tests?


Can you create a little test project, upload it somewhere and post a
link?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Hi Trapulo,

Thanks for posting in the community.

From your description, I know that when you set the checked state of a
checkedlistbox, the checkedlistbox control on the winform was not checked.

Did the problem persists when you just set the checked state with the hard
code state.
e.g.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.CheckedListBox1.SetItemChecked(1, True)
End Sub
After click the button, did the control was checked on the form.

Also can you simplify your code to reproduce the problem and post here or
send me a project by removing the "online" from my email address.

I look forward to hearing from you.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #3

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:ZP**************@cpmsftngxa07.phx.gbl...
Hi Trapulo,

Thanks for posting in the community.

From your description, I know that when you set the checked state of a
checkedlistbox, the checkedlistbox control on the winform was not checked.
yes
Did the problem persists when you just set the checked state with the hard
code state.
e.g.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.CheckedListBox1.SetItemChecked(1, True)
End Sub
After click the button, did the control was checked on the form.
Yes, if I use this the control is checked
Also can you simplify your code to reproduce the problem and post here or
send me a project by removing the "online" from my email address.


I try. I don't know if I can because the application is a little complex...


Nov 20 '05 #4

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

Similar topics

1
by: Phil Galey | last post by:
In VB.NET, is there a way to make it so the user can select items in a CheckedListBox, but is NOT able to check them? Even if I set Locked = True, the user is still able to both select and check...
0
by: Matt C. | last post by:
Does the CheckedListBox support DisplayMember/ValueMember? I have been trying to use these properties with the CheckedListBox and they are not working. I see from Google that databinding is not...
1
by: Tamir Gal | last post by:
Hi, I'm using the CheckedListBox control, and I'm wondering if there is a way to let the user check an item in the list without also selecting it... Any ideas? Thanks in advance, Tamir.
4
by: Reza | last post by:
Hi, I want to check one of the memebrs of a checkedListbox based on its value. I 'm getting a number(say 1355) from another control and based on that number I want to check an item which its...
1
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. ...
3
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. ...
3
by: Steve Cutting | last post by:
Hi all, I have a CheckedListBox on one pane of a TabControl on a form. I find that whenever the user clicks a different tab then comes back, any checks that were in the list have disappeared. ...
0
by: Terry Olsen | last post by:
Dim dirs() as string = Directory.GetDirectories(MyPath) CheckedListBox.DataSource = dirs CheckedListBox.Update For I as Integer = 0 To CheckedListBox.Items.Count - 1...
6
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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...
0
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...

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.