I have a small project here in visual studio 2022, a Winforms c++/CLR project.
It is a pretty simple project and form, but I have an issue with the following:
In the Winforms app I use a small panel to display the status of some input that I get.
I want to change the background colour of the panel depending on the status of that variable.
So for example if the variable is 0, the background colour should be red, if the value of the variable is 1, it should be green.
I can easily make this work, when this is coupled to a trigger event from the user, such as mouseclick, mousehover, ….
But how do I make this work dynamically during runtime, such that even while the variable changes during runtime, the backgroundcolour of the panel changes with it too, without the need of a user input event such as a mouseclick, … ?
What kind of class need to be made in order to make this work?
Leave an answer