CheckedListBox Enabling scrollbar when checkedListBox disabled

When you do this:

checkedListBox.Enable = false;
It also disables the scrollbar.

I am wondering if there is an easy way to enable scrolling when the checkedListBox is disabled.
My main purpose of doing checkedListBox.Enable = false, is so the user can not currently
check/uncheck items.
LVL 6
RishadanPortAsked:
Who is Participating?
 
CartoonHeadCommented:
You need to set checklistbox.Enabled = true then checkedListBox.SelectionMode = SelectionMode.None disables selection while the scroll bar is still active.
0
 
CartoonHeadCommented:
You can set  checkedListBox1.SelectionMode = SelectionMode.None; to disable selection while scrolling is still enabled.

You could also change the BG colour (if you wished)  to make it look disabled...
0
 
Jaime OlivaresSoftware ArchitectCommented:
another way is to manage the checklistbox's ItemCheck event, like this:

private void CheckedListBox1_ItemCheck(Object sender, ItemCheckEventArgs e)
{
     e.NewValue = e.CurrentValue;
}
0
 
RishadanPortAuthor Commented:
i don't see how this enables scrolling while the checklistbox.Enable feature is set to false.
0
 
RishadanPortAuthor Commented:
Ah I see thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.