473,761 Members | 10,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem checking checkedlistbox

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

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

' cut: logic to set maycheck variable

cbTimeOptions.S etItemChecked(j j, 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 1220
* "Trapulo" <no**********@q ui.it> scripsit:
I've some problem checking items in a checkedlistbox by code:

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

' cut: logic to set maycheck variable

cbTimeOptions.S etItemChecked(j j, 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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.CheckedListB ox1.SetItemChec ked(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.m icrosoft.com> wrote in message
news:ZP******** ******@cpmsftng xa07.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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Me.CheckedListB ox1.SetItemChec ked(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
4104
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 items. The Locked property appears to be a dummy switch. Setting the CheckOnClick property to False gets me half way home, as it requires the user to click a second time in order to toggle the checkbox of the selected item; however, I need to...
0
4567
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 supported on this control. Ok, fine. I tried to work around this by using DictionaryEntries, which still didn't work (see code below). Now I see in VS Help that DM/VM are not even listed as properties of the CheckedListBox (they are in VS...
1
4964
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
3737
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 value is 1355,how can I do that? thannks.
1
1568
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. This work fine for most cases, allowing the user to resize the form (and controls within the form. The forms them selves are create dynamically when the user drags a node from a listview to a panel (contained in a Usercontrol which is hosted by...
3
1645
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. This work fine for most cases, allowing the user to resize the form (and controls within the form. The forms them selves are create dynamically when the user drags a node from a listview to a panel (contained in a Usercontrol which is hosted by...
3
4704
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. After a bit of experimenting I have discovered that the problem only occurs when the CheckedListBox is using a dataset table as the source. If I manually add items to it's collection using the properties window, it works fine. If I bind it to a...
0
1717
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 CheckedListBox.SelectedIndex = I DoMySub(CheckedListBox.SelectedItem) Next The first line in the For loop (CheckedListBox.SelectedIndex = I) sometimes
6
6934
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
9521
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
9945
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9900
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8768
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
7324
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
6599
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
5214
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
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3863
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

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.