Solved

Visual Basic 2005 CheckedListBox control question

Posted on 2010-09-04
1
538 Views
Last Modified: 2013-12-20
The below code is In the Click sub of a CheckedListBox, the code checks and unchecks a single row inside a checkedListBox with a single click.  EXCEPT FOR if the end user clicks and then re clicks on the same row.  The control will not respond to the 2nd single click without clicking on another row inbetween single clicks.  The name of the control is ChkProviders.  There appears to be some sort of refresh needed inbetween each change?

        Dim chkstate As CheckState
        chkstate = ChkProviders.GetItemCheckState(ChkProviders.SelectedIndex)
        If chkstate = CheckState.Checked Then
            ChkProviders.SetItemCheckState(ChkProviders.SelectedIndex, CheckState.Unchecked)
        Else
            ChkProviders.SetItemCheckState(ChkProviders.SelectedIndex, CheckState.Checked)
        End If
 
0
Comment
Question by:dastaub
1 Comment
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 33605998
You can have the same functionality by setting the CheckOnClick property of the CheckedListBox to True.

Wayne
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now