| Downloads | |
|---|---|
| Sorry, No PDF | No Required Download |
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: http://www.microsoft.com/express/downloads/#2010-Visual-CS and for 2008 here: http://www.microsoft.com/express/Downloads/Download-2008.aspx#2008-Visual-Basic
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
if (textbox1.text == "the text that you want it to equal here"
messagebox.show("what ever you want the message box to show.")
else
messagebox.show("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 =)






