Beginners C# Tutorial

Beginners C# Tutorial

Postby themitchel0 » November 26th, 2012, 11:43 pm

Ok this is my first of hopefully many tutorials on the topic of the programming language c#. At the end of this tutorial you will hopefully be able to use if else statements, message box’s, and buttons.

So let’s get started.

What you need for this tutorial is ether Microsoft visual studios c# express edition 2008 or 2010. The link to download is here: and for 2008 here:

Open up your selected coding program and do this, and select new project from ether the button under the file button( located in the upper left hand corner), or from the file button ( File > New project), or by pressing crt+ shift + n. select windows form application. It is the first one on the list.


Drag 1 textbox 1 button onto the form. It should look a little like this: (you can change the buttons text in the properties window which is located in the toolbar or on the right hand side)


We then need to double click on the button. This will bring us to the coding page.


Then type

Code: Select all
if (textbox1.text == "the text that you want it to equal here")"what ever you want the message box to show.")
else"something else that u wanted to say")

This is what it should look like:


The first line is saying that if the text in the text box is equal to something then this happens. The third line is saying, if anything else happens then do this.

Now if you go into the upper right hand corner of the screen there should be a little green arrow( or a different color depending on which version you have), you could also push f5 or go to the debug menu.

This will run the program that you have made.


This is some basics in C# hope you enjoyed and learned something =)
Posts: 365
Joined: June 15th, 2010, 8:31 am

Re: Beginners C# Tutorial

Postby IrascibleOne » November 27th, 2012, 12:33 am

Moved this tutorial out of the main part of the site. This move is part of the Move Non-Graphics Tutorials part of the DS task list.

themitchel0, feel free to edit your tut as much as you like. I'll be removing the tutorial from the resources section of the site within the next few days.
User avatar
Site Admin
Site Admin
Posts: 1543
Joined: July 31st, 2008, 7:14 pm
Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest