Change background colour of checkbox box

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
IanUoY
Posts: 91
Last visit: Wed Sep 20, 2023 2:44 am

Change background colour of checkbox box

Post by IanUoY »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: 2019 5.6.161
32 or 64 bit version of product: 64
Operating system: W10
32 or 64 bit OS: 64

How do I change background colour of the actual checkbox box itself?
If I change BackColor property then just changes background of the component not the checkbox itself.

Cheers

Ian
cb1.PNG
cb1.PNG (570 Bytes) Viewed 1463 times
cb2.PNG
cb2.PNG (694 Bytes) Viewed 1463 times
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Change background colour of checkbox box

Post by davidc »

[TOPIC MOVED TO THE POWERSHELL GUIS FORUM BY MODERATOR]

To do this, you will need override the paint event and draw the checkbox manually. Refer to the following link for more details:

https://stackoverflow.com/questions/352 ... a-checkbox

The default rendering is handled by the system.
David
SAPIEN Technologies, Inc.
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked