?
Solved

Visual Basic 2005 CheckedListBox control question

Posted on 2010-09-04
1
Medium Priority
?
556 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 47

Accepted Solution

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

Wayne
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

719 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