473,287 Members | 1,570 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,287 software developers and data experts.

Disable Checkbox in TreeView control

Does anyone know how to disable a single check box in a Windows Forms
TreeView control.
Jun 9 '06 #1
3 18080
Handle the BeforeCheck event and cancel any attempts to check it.

/claes

"James Lennon" <Ja*********@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
Does anyone know how to disable a single check box in a Windows Forms
TreeView control.

Jun 9 '06 #2
This will stop a user from checking the check box but the control does not
look disabled. I can set the foreground color of the text but not the text
box. Is there a way to get a handle to the actual text box.

"Claes Bergefall" wrote:
Handle the BeforeCheck event and cancel any attempts to check it.

/claes

"James Lennon" <Ja*********@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
Does anyone know how to disable a single check box in a Windows Forms
TreeView control.


Jun 9 '06 #3
I assume you mean checkbox (you wrote text box). The checkbox is just an
image in the state image list for the tree view (Windows generates 2 images
for you, one checked checkbox and one unchecked) so simply changing the
state image index for the node should work. Ofc, you'll need to add the
image for a disabled checkbox first. You can also replace the images with
your own if you'ld like. Here are some threads that might be of interest:

http://groups.google.com/groups?as_q...=2006&safe=off
/claes

"James Lennon" <Ja*********@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
This will stop a user from checking the check box but the control does not
look disabled. I can set the foreground color of the text but not the
text
box. Is there a way to get a handle to the actual text box.

"Claes Bergefall" wrote:
Handle the BeforeCheck event and cancel any attempts to check it.

/claes

"James Lennon" <Ja*********@discussions.microsoft.com> wrote in message
news:93**********************************@microsof t.com...
> Does anyone know how to disable a single check box in a Windows Forms
> TreeView control.


Jun 12 '06 #4

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

Similar topics

5
by: SoKool | last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control. I intend to use a treeview to generate a...
0
by: Satya Bojanapally | last post by:
Hi, How to use TreeView control for client side script with checkbox checked/unchecked. Regards, Satya
0
by: Krish | last post by:
Hi all, I have a TreeView control on a windows form with checkboxes enabled. I am trying to make certain checkboxes have a checked and shaded status but I am unable to set a node's checkbox...
1
by: Srinivasa Raghavan | last post by:
Hi All, I have some doubts on the Treeview control and Form Authentication 1) will Form Authentication work if cookies are disabled. 2) I have problem in the following code (TreeView...
0
by: marius | last post by:
Hi I'm trying to disable the TreeView control of the Microsoft WebControl package. When I set the disabled-property (from javascript), the control is blured/greyed out as expected, but it still...
3
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
1
by: yxq | last post by:
Hello, I need the treeview control like Explorer with checkbox for selecting the whole partition or folders, where to download or for sale? Thanks
1
by: japi | last post by:
Hi all, I have a TreeView control in my ASP.NET 2.0 Web application with checkboxes enabled. I would like to generate a postback when a user ticks or unticks a checkbox. As far as i know,...
1
by: joerozario | last post by:
dear friends, i have treeview control in asp.net 2005. there is an option to show ckeck box. when i click the root node check box, i want all the sub nodes to be checked. how to do that.? ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.