Solved

Visual Basic 2005 CheckedListBox control question

Posted on 2010-09-04
1
547 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to seperate number and letters from a string 3 22
VB.Net. Reading xml value 6 29
Finding Events logs for IIS website that restarts 2 14
System.net.Sockets Error 5 26
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

791 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