Sign in to follow this  
Kevin

[TUT] Visual C# Beginners Guide and Introduction to Visual Studio

Recommended Posts

Visual C# is an upper level language that is very flexible and easy to work with. The Microsoft Visual Studio development environment makes it easy to get started with C# and also simple to create GUI based forms and is a great language to start out with due to its "visual" nature.

The first step is to download and install Microsoft Visual Studio. The most current version can be found here http://msdn.microsoft.com/en-US/vstudio. After downloading and installing visual studio it is time to create your first project. Click File, New Project and then select "Windows Forms Application" from the list of possible project types. You should now be presented with a blank form and a toolbar with all of the form elements on the left. In the toolbar find the button component and drag one to the form. Next repeat the same process for the "label" element. Now single click on the button you just created and navigate to the properties window in the bottom left. We are going to change the name of the button from "button1" to something more useful. One of the first lines in the properties window should be "Name." Change the value to "myButton." This is the name that we will use to refer to it in code. Repeat the process for the label but name it "label_helloWorld."

Now we are ready to make our program do something. Double click on the button. You should now be presented with a code editor and a function that was automatically created. This is the code that will run when the button is clicked. Add the following code

label_helloWorld.Text = "Hello World!";

When the button is clicked it will change the text of the label to Hello World! Run the program with F5 or click the play button in the top menu bar.

Experiment with different things and different types of elements.

Share this post


Link to post
Share on other sites

Visual Studio makes C# quite easy to get a start at. It provides lots of tools and getting started is rather simple with its auto-complete features (its official name is escaping me at the moment). I would recommend C# as a starting language due to the high quality of Visual Studio but I would also recommend Python and C++. Python has a simple syntax and is dynamically typed which makes it easier to understand for some people. C++ on the other hand is very structured and that can be beneficial for some as well. I would recommend playing around with a few different languages and start learning the one that you like the best.

Share this post


Link to post
Share on other sites

I have been dabbling in C++ and am enjoying it, your videos were most helpful. I would like to learn as many languages as I can, without confusing myself of course. As far as C# goes, what kind of functions is it best suited for? Is it best for games or applications on windows or is it universal? I am curious because I was thinking of making it (or Python or java) my second language.

Thanks for your reply :).

Share this post


Link to post
Share on other sites

C# is windows only while python, java, and C++ are multi-platform. C# has the ability to create windows form applications, games (using a Microsoft SDK), and command line applications. It could be described as a windows "one stop shop."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this