Tristate checkboxes in TreeView?
-
Hello, I'm trying to use tristate checkboxes in my
TreeView
control. But I can't find how. TheChecked
property isbool
, and I was expecting aCheckState
property that isn't there. So, .NET 2.0 seems not to support it but I'm sure I have seen them (the indeterminate checkboxes) in other apps. Am I overlooking something? Thanks! :) -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
-
Hello, I'm trying to use tristate checkboxes in my
TreeView
control. But I can't find how. TheChecked
property isbool
, and I was expecting aCheckState
property that isn't there. So, .NET 2.0 seems not to support it but I'm sure I have seen them (the indeterminate checkboxes) in other apps. Am I overlooking something? Thanks! :) -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
Nope, you're not missing anything. I have some code that will do what you what, but I can't post it as an article since the bulk of it was taken from another article elsewhere, but I don't recall from where. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
-
Hello, I'm trying to use tristate checkboxes in my
TreeView
control. But I can't find how. TheChecked
property isbool
, and I was expecting aCheckState
property that isn't there. So, .NET 2.0 seems not to support it but I'm sure I have seen them (the indeterminate checkboxes) in other apps. Am I overlooking something? Thanks! :) -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
As has been said, no, you're not missing anything. The way to do it is to use imagelists with graphics stolen from elsewhere and just set the item to the check in question. You'd have to override mousedown to determine if a click is on-top of the image and then switch it to the appropiate image. That said, I'm sure there are third-party controls that already do it, but I never looked into it myself.