Link to home
Start Free TrialLog in
Avatar of John500
John500Flag for United States of America

asked on

How to change a listBox 'BackColor' during runtime ?

Greetings:

I have a .Net Form Application and need to toggle a listBox background color from red to green during run-time.  I realize the listBox property has this setting in the designer mode but that doesn't do me any good.

I'm guessing the syntax goes like this:

listBox1->BackColor =  some hex value

If there is a list of all available colors that would be even better, otherwise red and green are fine.

I did some reading on-line and saw something like the stuff below ... is all that necessary ?

public:
virtual property Color BackColor {
    Color get () override;
    void set (Color value) override;
}
ASKER CERTIFIED SOLUTION
Avatar of lakshman_ce
lakshman_ce

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lakshman_ce
lakshman_ce

Avatar of John500

ASKER

Thanks again !