Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Tristate checkboxes in TreeView?

Tristate checkboxes in TreeView?

Scheduled Pinned Locked Moved C#
csharpcomtoolsquestion
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luis Alonso Ramos
    wrote on last edited by
    #1

    Hello, I'm trying to use tristate checkboxes in my TreeView control. But I can't find how. The Checked property is bool, and I was expecting a CheckState 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

    J J 2 Replies Last reply
    0
    • L Luis Alonso Ramos

      Hello, I'm trying to use tristate checkboxes in my TreeView control. But I can't find how. The Checked property is bool, and I was expecting a CheckState 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

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • L Luis Alonso Ramos

        Hello, I'm trying to use tristate checkboxes in my TreeView control. But I can't find how. The Checked property is bool, and I was expecting a CheckState 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

        J Offline
        J Offline
        Joel Lucsy
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups