Page 1 of 1

Checkbox flatappearance.checkedbackcolor didn't work

Posted: Fri Nov 26, 2021 5:08 am
by DVVGmbH
Powershell

$checkbox1.flatstyle = 'flat'
$checkbox1.flatappearance.checkedbackcolor = 'green'

I use the Sapien Powershell Studio 2020.
Nothing changed when I configure the second line.
The same with this code:
$checkbox1.flatappearance.checkedbackcolor = [system.drawing.color]::fromARGB(255,...)

Re: Checkbox flatappearance.checkedbackcolor didn't work

Posted: Fri Nov 26, 2021 11:57 am
by jvierra
You can't change the color after the checkbox has been displayed. Set the color in the properties of the control.

Re: Checkbox flatappearance.checkedbackcolor didn't work

Posted: Wed Dec 01, 2021 3:36 am
by DVVGmbH
Hi jvierra,
thanks for your answer.
The problem ist, that there ist no effect, when I configured it in the "Designer"-Area of the Powershell Studio. It is no problem to Change the "FlatStyle" to "Flat", but the "FlatAppearance" didn't work.
I hope, you understand me, my english ist not so good...
Best regards
Ralf.

Re: Checkbox flatappearance.checkedbackcolor didn't work

Posted: Wed Dec 01, 2021 3:39 am
by DVVGmbH
... I can change the "checkedbackcolor", but when I start the script, there is not the new color.

Re: Checkbox flatappearance.checkedbackcolor didn't work

Posted: Sat Dec 04, 2021 10:30 pm
by jvierra
Please read the following link very carefully. Be aware that the backcolor of the Checkbox is dynamic and sets only when the CheckBox is checked AND COMMITED
https://stackoverflow.com/questions/544 ... or-uncheck.