Click here to Skip to main content
15,446,510 members
Articles / Desktop Programming / Windows Forms
Posted 2 Jul 2007


28 bookmarked

Create your first Web Application with GOA WinForms

Rate me:
Please Sign up or sign in to vote.
4.49/5 (14 votes)
2 Jul 20074 min read
This article describes how to create a very simple project using GOA WinForms for Flash


This article describes how to create a very simple project using GOA WinForms for Flash. Even if we will focus on the Flash target, the process for creating a project targeting Microsoft Silverlight is very close to the one that is described in the article.

GOA WinForms allows developers to build web applications using their WinForms experiences and skills. It is an implementation of the standard System.Windows.Form .NET library for both Adobe Flash and Microsoft Silverlight. It allows .NET developers to write standard WinForms applications that will run on these two RIA platforms.

GOA WinForms contains the full-featured System.Windows.Forms core library, enabling to freely develop and deploy Flash & Silverlight RIA applications using Microsoft Visual Studio.

The basic package of GOA WinForms is completely free to use and deploy. It includes 40+ standard controls and components.

Using the code


Creating a GOA Project Using Visual Studio

  • Start Visual Studio 2005
  • On the File menu, click New Project
  • In the New Project" dialog box, under the "GOA Projects" folder, choose GOA Application
  • Name your application "HelloWorld" and click OK

A new Visual Studio project is created.

Open the Form1.ccs file that has been automatically generated. In this file, you can watch the code of an "almost standard" .NET Windows Form holding a button.

Compile and run the HelloWorld application

  • On the Debug menu, click Start
  • A dialog box asking if you would like to build the project is displayed. Click Yes to build the project
  • The application starts. A form holding a button is displayed

Here is what has happened when you have started debugging the application:

  • The code of the application has been compiled using the GOA compiler
  • A swf file ("executable" Flash file) has been generated
  • The swf file has been loaded inside the Visual Studio Internal Web Browser

If you go to the bin\Debug subdirectory of your project using Windows Explorer, you will see two files:

  • The HelloWorld.swf file is the swf file that has been generated by the compiler from the C# code of the project
  • The HelloWorld.swf.html page is a basic HTML page that has been generated to load the HelloWorld.swf file

Note that the project has been compiled using the GOA compiler and not the .NET C# compiler. The GOA compiler allows to generate a swf ("executable" Flash file) from C# code.

Also note the ccs extension of the Form1.ccs file. This is the default C# file extension for GOA.

The swf file that you have just compiled can be run under Flash Player version 7 or above. Nevertheless, it is recommended to target Flash Player version 9 or above.

  1. In the Solution Explorer Right Click your project
  2. In the drop down menu, click the Properties item
  3. On the right of the Property Pages dialog box, select the Build node under the Configuration Properties node
  4. Change the Platform Target value to Flash 9 or higher
  5. Click OK

Now that your platform target is Flash 9, the swf will run a lot faster but it will not be compatible with the earlier versions of the Flash Player.

Add a Button and a Label to Form1

Now that we understand the basics of GOA WinForms for Flash, we can write some code in the HelloWorldForm class to create our Hello World application.

Note that we are coding our project in a standard way as if we were creating a .NET Windows Forms desktop application.

We are adding a label at the top of the form and moving the button at the bottom. When the user will click on the button, the label will display the "Hello World" text.

We are adding a label at the top of the form and moving the button at the bottom. When the user will click on the button, the label will display the "Hello World" text.

  • First let's add a label to the form and move the button at the bottom of the form. The code that follows is very close to any code generated by the Visual Studio Windows Forms Designer:

    public class Form1 : System.Windows.Forms.Form 
       private Button button1;  
       private Label label1;   
       private System.ComponentModel.Container components = null;  
       public Form1()  
       protected override void Dispose(bool disposing)  
          if (disposing)  
             if (components != null)  
       private void InitializeComponent()  
          this.button1 = new System.Windows.Forms.Button();  
          this.label1 = new System.Drawing.Point(84, 140);  
          this.button1.Name = "button1";  
          this.button1.Size = new System.Drawing.Size(104, 36);  
          this.button1.Text = "Click Me";
          this.label1.Location = new System.Drawing.Point(40, 44);  
          this.label1.Name = "label1";  
          this.label1.Size = new System.Drawing.Size(200, 44);  
       static void Main()  
          Application.Run(new Form1()); 

  • We also need to add an event handler to manage the button click event.

    Add the following line in the InitializeComponent method of the form:

    this.button1.Click += new EventHandler(button1_Click);

    And, of course, we also have to add the method that will set the text of the label:

    void button1_Click(object sender, EventArgs e) 
      this.label1.Text = "Hello World"; 

Before starting the application, let's change the settings in order to start it in an external browser.

  • In the Solution Explorer, right click your project
  • In the drop down menu, click the Properties item
  • On the right of the Property Pages dialog box, select the Debugging node under the Configuration Properties node
  • Change the Start Program Type value to Internet Explorer
  • Click OK

Now, you can start your application.

Points of Interest

This article is only a quick introduction but it shows that it is now possible to create web application using only your WinForms programming skills.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Written By
Web Developer
Belgium Belgium
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

GeneralMy vote of 1 Pin
Saket Vyas18-May-11 9:58
MemberSaket Vyas18-May-11 9:58 
GeneralClient Requirements Pin
C# Genius6-Aug-07 5:41
MemberC# Genius6-Aug-07 5:41 
QuestionErrors during start Pin
malymaly2-Jul-07 23:28
Membermalymaly2-Jul-07 23:28 
AnswerRe: Errors during start Pin
Jeff Karlson2-Jul-07 23:53
MemberJeff Karlson2-Jul-07 23:53 
GeneralRe: Errors during start Pin
malymaly3-Jul-07 1:16
Membermalymaly3-Jul-07 1:16 
GeneralRe: Errors during start Pin
Jeff Karlson3-Jul-07 1:30
MemberJeff Karlson3-Jul-07 1:30 
GeneralBrowser selection Pin
Cliff Stanford2-Jul-07 5:24
MemberCliff Stanford2-Jul-07 5:24 
GeneralRe: Browser selection Pin
Jeff Karlson2-Jul-07 23:14
MemberJeff Karlson2-Jul-07 23:14 
GeneralRe: Browser selection Pin
Cliff Stanford3-Jul-07 3:20
MemberCliff Stanford3-Jul-07 3:20 
GeneralRe: Browser selection Pin
Jeff Karlson3-Jul-07 3:47
MemberJeff Karlson3-Jul-07 3:47 
GeneralRe: Browser selection Pin
Cliff Stanford3-Jul-07 4:51
MemberCliff Stanford3-Jul-07 4:51 
Yup and Safari and Opera.

The point was that it doesn't work from inside VS.

GeneralI saw this the other day Pin
leppie2-Jul-07 4:55
Memberleppie2-Jul-07 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.