SharpDevelop Community

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

Matt Ward

Creating a Windows Application

With SharpDevelop you can create and develop many different types of project:

  • ASP.NET Web Page Project
  • ASP.NET Web Service
  • Class Library
  • Console Application
  • Direct 3D Application
  • WPF Application
  • WPF Navigation Application
  • Windows Application
  • Windows Application for the Compact Framework
  • Windows Service
  • Windows User Control Library
  • WiX Setup Project

The following sections will walk you through creating a Windows Application for the C# language.

Creating a Windows Application

To create a new Windows Application, from the File menu, select New and then select Solution....

Menu option to create a new solution

This opens the New Project dialog box.

New Project dialog

From this dialog you can choose from many different project templates that are grouped into different categories. Expand the C# category, select the Windows Applications category, and then select Windows Application from the list of available templates. Type in a name for the project and choose where you would like the project to be created. Click the Create button to generate the project. The project will then be opened by SharpDevelop ready for you to start developing.

Windows project open inside SharpDevelop

Click the above image to see a larger version with added notes explaining the various parts of the user interface.

Building the Application

From the Build menu select either Build Solution or Build <Your Project Name>.

Menu option to build a project

Build messages will be displayed in the Output window as the build progresses.

Output window showing build messages

When the build is completed any errors will be listed in the Errors window.

Build errors displayed in Errors window

Running the Application

From the Debug menu select Run or Run without debugger.

Menu option to run the application

Your application will then be started and its main form will be displayed.

Windows application running

Adding a New Form

SharpDevelop provides many different types of file templates which you can add to your project:

  • Configuration classes
  • Class
  • Form
  • Interface
  • Module
  • MSBuild File
  • Setup Dialog (WiX)
  • Setup Document (WiX)
  • Singleton Class
  • Struct
  • Unit Test
  • User Control
  • Web Control
  • Web Form
  • Web Service
  • WPF Flow Document
  • WPF Page
  • WPF User Control
  • WPF Window
  • XML File

To add a new form to your Windows Application, open the Project Explorer, if it is not already open, by selecting Projects from the View menu.

View projects menu option

In the Projects Explorer select the name of your project, right click, select Add and then New Item....

Menu option to add a new file to a project

This opens the New File dialog box.

New File Dialog

Expand the C# category, select the Windows Applications category, and then select Form from the list of available templates. Type in the desired name of the file and then click the Create button to add the new form to your project.

In the next section you will see how to visually design your forms.

< previous | home | next >

Published Jul 05 2006, 11:52 AM by MattWard
Filed under:


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