-3

I created a brush to assign a color the the button foreground. But I cannot figure out to retrieve the color back? I find a few solutions but there were very complicated.

I set the button foreground color to be BLACK.

Now I need a code that, provided with a button, retrieve the color and returns BLACK (in this example).

John V
  • 4,855
  • 15
  • 39
  • 63

1 Answers1

0

If you want to retrieve the current color of your element you can simply assign a new Color variable from the button like this:

Color getColor;
getColor = button1.ForeColor;
Console.WriteLine(getColor); /* To print the retrned color in the debug console */