locked
How to set a check box to checked or unchecked programmatically?

    Question

  • The theory say, that the IsChecked property is a right way. But if I write:

    MyCheckBox->IsChecked = true;

    the compiler reports an error. This is ok, because IsChecked is an instance of the IReference<bool>. The IReference<bool>::Value property is read-only! Instead I must create an own IReference<bool> with TRUE or FALSE and assing it to the MyCheckBox->IsChecked, theoretically.

    In C# you can easy assing a true to this property:

    MyCheckBox.IsChecked = true;

    How do I do that in C++?

     

    Thank you in advance

    Wednesday, February 01, 2012 3:35 PM

Answers