C# - Three State CheckBoxes

Discussion in 'OT Technology' started by Scoob_13, Jun 10, 2003.

  1. Scoob_13

    Scoob_13 Anything is possible, but the odds are astronomica

    Joined:
    Oct 5, 2001
    Messages:
    73,784
    Likes Received:
    38
    Location:
    Fort Worth. Hooray cowgirls.
    Hmm, how on earth does one set the third semi-true state? :confused: I can't seem to find this out, and for some reason my MSDN doesn't say how, nor does my C# book.

    Also, how do I set the state to show it checked? I'm using another function to handle the checked status, and I need this one to show checked if the other is true. I'm attempted to set it true from the other function, however it's not working too terribly well.
     
  2. dm33186

    dm33186 Guest

    im going to assume checkbox1 is the main one and its supposed to check checkbox2 heres the code

    Code:
    checkbox1_changed
    {
         if(checkbox1.checked==true)
              {
                    checkbox2.checked==true;
              }
    }
    
    
    that should do it if its what i think you want, of couse your going to need to capatilize all that, i dont have vsnet here so i cant remember the exact syntax
     
  3. Scoob_13

    Scoob_13 Anything is possible, but the odds are astronomica

    Joined:
    Oct 5, 2001
    Messages:
    73,784
    Likes Received:
    38
    Location:
    Fort Worth. Hooray cowgirls.
    Well, sort of, but I need to know how the three state checkbox works, where it's true, partially true, and false (black check, greyed out check, no check)

    That did solve my problem about checking off other boxes though :bigthumb:
     
  4. dexedrine

    dexedrine Guest

    checkBox1.CheckState = CheckState.Indeterminate;

    that will make it gray. there's also CheckState.Checked and .Unchecked. perhaps this will help?
     

Share This Page