Saturday, April 24, 2010

Creating a Form in Visual C#

The first thing we need, is a Windows Forms Application. It's a form, a box, like you've already seen in other Windows applications. Before we start, we need a Microsoft Visual Studio 2008. I would recommend using the Visual C# 2008 Express Edition, which is available for free on the Microsoft website. I use the 2008, so all my projects here are created using the same. Download it, install it and you're ready to go.

Once you have the software, run it, and here we go.

Step 1:

Click File from the top menu, a open a New Project (you can use the shortcut Ctrl+Shift+N). You will see few templates that can be used for creating various applications. We need a Windows Form Application, so pick that one.

Step 2:

Now you have a Form. It's default name is Form1. Of course, the initial Form is empty. You can use the Toolbox on the left for adding various items on it and make them do stuff. On the right, we have the Solution Explorer (we'll talk about it later) and the Properties Window. Once you click on your Form, you can use the Properties Window to change it. Color, name, size, font and similar things used by your needs and taste. Every single item, for example, a button, can be changed to fulfill your needs. But, we'll talk about that later, as well.

You have your first Form. It's doesn't do anything for now, it's just a simple empty Form, just standing there. In the next lesson on Tiny C#, I'll teach you how to add stuff on your Form and make it do some interesting things.

Tiny C#, 2010

Back to TOP