3.1. Your First C# Project: Hello, World

To introduce you to some of #develop's features, we'll create the classic example program - "Hello, World". This example will be written using the C# language.

To create the new program:

  1. Select the File, New Project... menu:

  2. From the new project screen, select the C# category on the left, and choose the "Windows forms project" template. Type a name for your new project (MyHelloWorld), and select a Location:

    Tip

    #develop can automatically create a project and source directory for you. Just tick the checkboxes in the new project dialog.

  3. #develop creates a default set of files for your new project. You can view all the files it creates by expanding the Combine and Project in the Project Scout at the left-hand side of the IDE, and double-clicking the individual files. For now, double-click the MainForm.cs file. This will open the file in the right-hand area of the IDE and allow you to view and edit the code.

  4. Now let's enter the code to show a messagebox with our standard text message: "Hello, World!". Type the following code into the MainForm declaration:

    MessageBox.Show("Hello, World!");

    Your MainForm.cs should look like this (the inserted code is highlighted):

  5. OK, let's build our solution and see if we typed the line correctly! Select the Run menu, and Build

    Tip

    Hotkey: F8 to Build your Combine

  6. Check the results of your Build in the Output window in the bottom-right corner of the #develop IDE.

  7. Everything looks OK! Lets run our program using the "Run" menu's "Run" item:

    Tip

    Hotkey: F5 to Run your Combine

  8. Success!