SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Matt Ward

Your First VB.NET Project: Hello, World

To introduce you to some of SharpDevelop's features, we will create a simple "Hello, World "Windows application. This example will be written using the VB.NET language.

Creating a New VB.NET Application

  1. From the File menu, select New and then Solution... or use the shortcut Ctrl+Shift+N or click New solution on the Start Page.

    File New Solution Menu Item

    This opens the New Project dialog. This dialog shows all the various projects that SharpDevelop can create.

  2. From the New Project dialog, expand the VBNet category and select the Windows Application category.
  3. From the list of available templates, select Windows Application.
  4. Type in a name for the new project (e.g. HelloWorld).
  5. Enter the folder location for the new project. Type in the full path or click the browse button to use the Browse for Folder dialog to choose a folder. The default location should be fine, but you are free to choose another location for the project. In the screenshot above, the project has been given the name HelloWorld and the location has been set to "C:\Projects". At the bottom of the dialog you can see that the new project will be created in the folder "C:\Projects\HelloWorld".
  6. Click the Create button. SharpDevelop will create the project and open it. On the left hand side you can see the project in the Project Explorer. Expand HelloWorld to see all the files that project contains. In the middle the project's main form MainForm.vb is opened.

Editing the Code

  1. Now you will modify the MainForm class so the title of the window of your HelloWorld application is set to "Hello, World!". Delete the three TODO comment lines and type in the following single line of code:

    Me.Text = "Hello, World!"

    Your MainForm should now look like this.

Building the Application

  1. From the Build menu, select Build HelloWorld .

  2. As the project builds messages will appear in the Output window. If the build was successful you should see the messages as shown below.

Running the Application

  1. From the Debug menu, select Run or use the F5 keyboard shortcut.

    This will run your application and its main form will be displayed.

    Congratulations, you have written your first VB.NET application.

Published Jun 26 2006, 02:20 PM by MattWard
Filed under:

Comments

No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.