help with arduino and c#

Hello . i would like help me. i would like create a project with arduino and c#. when the push button is on in the c# panel1.BackColor = Color.Lime; and when the push button is off in the c# panel1.BackColor = Color.Red; . i know create the interface with c# and arduino ex i know push the button in c# and led on in arduino.

thank you very much.

sorry but i dont know very good english

The Arduino needs to send data to the C# application, via the serial port, using Serial.print(), Serial.println(), and/or Serial,write(). This should be done when the Arduino determines that something of interest, like a switch being pressed, has happened.

The C# application needs to have a callback registered that gets invoked when the Arduino sends serial data. That callback needs to read the serial data, and determine the correct action. Then, it needs to perform that action.

The user interface processing in a C# application usually runs in one thread, and the serial processing in another thread. The serial processing thread can not directly modify the user interface. It needs to Invoke() (that's a hint) a method in the user interface thread to perform the user interface change.