473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

CheckedListBox disabled, how to scroll?

Hi,

A simple, but yet frustrating issue. I am using CheckedListBox control on a
Windows Form in a C# application. When I disable CheckedListBox, the vertical
toolbar is becoming disabled also. So the user has no way to scroll control
up and down to see what items are checked and what are not.

Is it a way to disable control (so the user wouldn’t be able change checked
items), but leave the control scrollable?

Can be done by overriding WndProc and canceling some messages there?

Thanks,
Victor
Jun 27 '08 #1
2 3539
"Victor" <Vi****@discussions.microsoft.comwrote:
Is it a way to disable [CheckedListBox] (so the user wouldn’t be able
change checked items), but leave the control scrollable?
You probably could use WndProc, but here's a quick hack that does it
more simply:

private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs
e)
{
e.NewValue = e.CurrentValue;
}

Eq.
Jun 27 '08 #2
I found a solution. Overriding OnItemCheck works nicely.
Thanks.

bool disableCheckBoxes = true;

protected override void OnItemCheck(ItemCheckEventArgs ice)
{
if (disableCheckBoxes)
ice.NewValue = ice.CurrentValue;

base.OnItemCheck(ice);
}

"Victor" wrote:
Hi,

A simple, but yet frustrating issue. I am using CheckedListBox control on a
Windows Form in a C# application. When I disable CheckedListBox, the vertical
toolbar is becoming disabled also. So the user has no way to scroll control
up and down to see what items are checked and what are not.

Is it a way to disable control (so the user wouldn’t be able change checked
items), but leave the control scrollable?

Can be done by overriding WndProc and canceling some messages there?

Thanks,
Victor
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bill Sonia | last post by:
It seems whenever I set a DataGrid.DataSource = DataTable (vb.net) to populate a datagrid, the scroll bars on the datagrid default to disabled. And the only way I can get them to enable is to...
3
by: Rab | last post by:
Hi I have a TextBox on my form with Enable=False and Lock=True which needs to display comments but not allow the user to edit it. Since some comments are long, I need a scroll bar to allow the...
2
by: Erik Cruz | last post by:
Hi. I have read some articles about hosting windows forms controls on asp.net pages but all of them show how to use custom controls. I would like to show on one of my pages the checkedlistbox...
2
by: Manuel Canas | last post by:
Hi there, I'm having this dilema with a checkedlistbox. I have an array of items in there, what I want to accomplish is the following; The user could check all the items in the...
2
by: Brian Mitchell | last post by:
Is it possible to gray out individual items in the CheckedListBox? I have an option at the top of the list that simply says 'All', and when the user clicks that item I want the rest of the items in...
0
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...
8
by: ameen.abdullah | last post by:
Hi Guys, I have a checked list box on my form.. the purpose of this checkbox is to indicate that the option is enabled or disabled.. I just want to ask if there is a way to disable these check...
6
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
by: R.Nijkamp | last post by:
Hello, i was wondering if its an limitation of IE when a asp.net listbox is set disabled, then a user wont be able to scroll inside the listbox. While the user can scroll inside the listbox when...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.