How to build app with c# code?

Good day

I would like to know what to do to make an app work, and what to add if I only got the source code like in the examle on this page and the source below:

C#.NET Code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
public partial class Form1 : Form
public Form1()

private void trackBar1_Scroll(object sender, EventArgs e)
serialPort1.Write(trackBar1.Value + "s");

private void Form1_Load(object sender, EventArgs e)

I do have Microsoft Visual Studio installed.

That's not all of the source code, it won't work, you need the .Designer.cs file that goes with that file

Thanks, I have tried to copy and paste the code to Visual studio & then added the Serial port tool and set It to COM4 as well as added a slider, and the error I got did mention "Projects\Slider\obj\Debug\Slider.dll' doesn't contain any UserControl types" this, so does that mean that there is a way to fix this, or is the control type unique to the user that designed the app?

Your "form" only has 2 components, why don't you start from scratch to avoid the error? It might be a project settings issue.

Hi I have tried to do this, bit I suck at c#. I will continue to look around for some source code like the c# code above, but with 2 servo support. Thanks anyway.

Why don't you let arduino deal with the servo controlling issue and just use C# to tell arduino what do to? I don't really know what you want to do but lets say that you are controlling the servo (s) with arduino, then you can create a C# that communicates with Arduino thru serial. As you are trying to use the track bar, you can just send to arduino the trackBarName.Value (int) and move the servo at your will with that value.