473,566 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3552
"Victor" <Vi****@discuss ions.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(obje ct sender, ItemCheckEventA rgs
e)
{
e.NewValue = e.CurrentValue;
}

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

bool disableCheckBox es = true;

protected override void OnItemCheck(Ite mCheckEventArgs ice)
{
if (disableCheckBo xes)
ice.NewValue = ice.CurrentValu e;

base.OnItemChec k(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
5917
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 manually resize a column width with the mouse (not very elegant). Anyone have any ideas how I could enable the datagrid scroll bars in my code? ...
3
11264
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 user to scroll up and down to view all of the comment. Scroll Bar property is already set to 'Vertical' but does not appear because the TextBox...
2
2173
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 windows control. I believe that the steps are the same, but what do I need to reference in my <object> tag in order to acomplish this? TIA, Erik...
2
2275
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 checkedlistbox, but always have at list one item always checked. so if the user has the last item checked and he/she wants to uncheck it, the item should reset...
2
2152
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 the box to become disabled. Thanks!!
0
1698
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 CheckedListBox.SelectedIndex = I DoMySub(CheckedListBox.SelectedItem) Next The first line in the For loop (CheckedListBox.SelectedIndex = I) sometimes
8
10762
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 boxes from being checked or unchecked.. i want them to always show their default value which i have fetched from a xml file.. and also i dont want...
6
6926
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
1609
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 he uses firefox. Below a simple code which i tested: <form id="Form1" runat="server"> <asp:ListBox id="drop1" rows="3" runat="server" disabled>
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8108
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.