Board index » cppbuilder » Setting Check for Checkbox

Setting Check for Checkbox

Hi,

I'd like to make a button which can alter the checkstate of a checkbox. So
when I push the button, some checkboxes must get checked and others must get
unchecked. I tried searching for a SetCheck function, but I only found one
for Visual C++, which I don't have. Maybe I could destroy it first to
recreate it. But I din't find a way to set a default value either. Can
someone help me please?

Thanks

 

Re:Setting Check for Checkbox


Hi,

MyCheckBox->Checked = true;

;-)

BR
Antonio

Re:Setting Check for Checkbox


Each TCheckBox has a Checked property, simply set that to true or false as
needed:

    CheckBox1->Checked = true;
    CheckBox2->Checked = false;

Gambit

Quote
"Bart Feyaerts" <bfeyae...@hotmail.com> wrote in message

news:3c5826f5_2@dnews...

Quote
> I'd like to make a button which can alter the checkstate of a checkbox. So
> when I push the button, some checkboxes must get checked and others must
get
> unchecked. I tried searching for a SetCheck function, but I only found one
> for Visual C++, which I don't have. Maybe I could destroy it first to
> recreate it. But I din't find a way to set a default value either. Can
> someone help me please?

Re:Setting Check for Checkbox


Set the property Checked to true or false;

        CheckBox5->Checked = true;
                -- or --
        CheckBox5->Checked = false;

Quote
Bart Feyaerts wrote:

> Hi,

> I'd like to make a button which can alter the checkstate of a checkbox. So
> when I push the button, some checkboxes must get checked and others must get
> unchecked. I tried searching for a SetCheck function, but I only found one
> for Visual C++, which I don't have. Maybe I could destroy it first to
> recreate it. But I din't find a way to set a default value either. Can
> someone help me please?

> Thanks

Re:Setting Check for Checkbox


Also if the property CheckBox->AllowGrayed=true the checkbox can have
the property CheckBox->State = cbGrayed | cbUnchecked while
CheckBox->Checked still is false. If Checked=true then State=cbChecked.
Quote
Johan Lundqvist wrote:

> Set the property Checked to true or false;

>         CheckBox5->Checked = true;
>                 -- or --
>         CheckBox5->Checked = false;

Re:Setting Check for Checkbox


In <3c5826f5_2@dnews>, Bart Feyaerts wrote:

Quote
> I'd like to make a button which can alter the checkstate of a checkbox. So
> when I push the button, some checkboxes must get checked and others must get
> unchecked.

That's not what check boxes are for. You need to learn the basics of
interface design.

        -- AK

--
Please reply to the newsgroup. That is why it exists.

Other Threads