Handle the BeforeCheck event and cancel any attempts to check it.
/claes
"James Lennon" <JamesLennon@di scussions.micro soft.com> wrote in message
news:93E845FC-C5E0-46C0-92E5-7BD23D87120B@mi crosoft.com...[color=blue]
> Does anyone know how to disable a single check box in a Windows Forms
> TreeView control.[/color]
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:
[color=blue]
> Handle the BeforeCheck event and cancel any attempts to check it.
>
> /claes
>
> "James Lennon" <JamesLennon@di scussions.micro soft.com> wrote in message
> news:93E845FC-C5E0-46C0-92E5-7BD23D87120B@mi crosoft.com...[color=green]
> > Does anyone know how to disable a single check box in a Windows Forms
> > TreeView control.[/color]
>
>
>[/color]
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:
"James Lennon" <JamesLennon@di scussions.micro soft.com> wrote in message
news:29A359A5-7E71-44F1-BAD3-A09A703C5F43@mi crosoft.com...[color=blue]
> 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:
>[color=green]
>> Handle the BeforeCheck event and cancel any attempts to check it.
>>
>> /claes
>>
>> "James Lennon" <JamesLennon@di scussions.micro soft.com> wrote in message
>> news:93E845FC-C5E0-46C0-92E5-7BD23D87120B@mi crosoft.com...[color=darkred]
>> > Does anyone know how to disable a single check box in a Windows Forms
>> > TreeView control.[/color]
>>
>>
>>[/color][/color]
Comment