Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

5
Trouble having all forms change colour on a button click
Post Body

A few classmates and myself are making a little music playlist windows form application for practice and I would like to code a button click event that allows the user to change between a couple of themes. So far I can manage to have the colours change no problem on a single form or even on multiple forms but the issue I'm having is that what I have so far doesn't seem like a very elegant solution.

if (BackColor==DefaultBackColor)

{

this.BackColor = Color.DarkGray;

f.BackColor = Color.DarkGray;

}

else

{

BackColor = DefaultBackColor;

f.BackColor = Color.DarkGray;

}

Basically right now I would be changing each individual forms colours manually on the button click and I'm wondering if there would be some easier solution like a global variable or a way to pass the changes between forms. I don't need a solution just a little nudge in the right kind of direction.

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
9,482
Link Karma
434
Comment Karma
8,826
Profile updated: 4 days ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago