Step 1: Open a new project
Open up Microsoft Visual Studio 2010 or Microsoft Visual C# 2010 and make a open a new C# Project and name it what ever you want. I will call mine "Arduino Led Controller". After you name it, click okay.
Step 2: Add your controlls
For this example, i will do 2 simple buttons to turn an led connected to pin 13 on and off. First Open the toolbox and click and drag the button onto the screen. Do this twice. Then add two pannels and resize the form, view the pics to see this.
Also add a serial port from the toolbox
Step 3: Rename your Buttons
Step 4: Add the code
Double click on the On button, and you should get a screen that looks like the first picture. Then in the block of the code add this code:
panel1.BackColor = Color.Lime;
panel2.BackColor = Color.Transparent;
then go up to the code:
and add this:
serialPort1.PortName = " ";
serialPort1.BaudRate = 9600;
in between the brackets.
we will add the PortName value in a later step.
Now go back to the design page and double click on the off button and add this code:
panel2.BackColor = Color.Red;
panel1.BackColor = Color.Transparent;