Search KB Filter article types
Running a Windows Forms Application Inside Your Web Browser
Categories: Introduction
Tags: Architects, Developers, 1. Beginner, Pre v6.3, v6.3, v6.4 and Later, 2. Intermediate, 3. Advanced
Revision: 1
Posted: 01/Jan/2008
Updated: 01/Jan/2008
Status: Publish
Types: Walkthrough

In the next 2 minutes, let me demonstrate how we can build a WinForms application and run it in our browser.

The first thing we need to do is install Visual WebGui and get all the functionality that is demonstrated in this post. You should register on the Visual WebGui site (http://www.visualwebgui.com) and then download and install the Visual WebGui development framework.

After we install the framework we are ready to start a new project.

Let's open a new Visual WebGui project:

The new project will include all the required files as displayed in our project's Solution Explorer.

As you can see, we are going to write a web application with WinForms inside a Web Application.

We'll open the form designer by double clicking on Form1.cs in the Solution Explorer

The Visual WebGui designer, which appears below, has the same look and feel as the WinForms designer.

We can resize our form to maximize our work area. We can do that by changing the Form Size property or resizing the form using the mouse, just like normal WinForms behavior.

After our form is resized, we can add a control or two by using "drag and drop" to put toolbox controls on our form.

We can look at the control properties and change the label's text.

Now we'll add a Button control and change it's properties as well.

After we're done designing our (very control rich) form, we'll go and write some code by double clicking the "Write Hello World" button.

Now we are ready to write our code, let's set the label's text to "Hello World".

private void btnHelloWorld_Click(object sender, EventArgs e)
 
        {
 
            this.lblMessage.Text  = " Hello World";
 
        }

After we completed our WinForms designing and written some code-behind we can finally run our sample.

Now we'll click on the "Write Hello World" button and see if our code works.

Woo!
We've clicked the WinForms button inside our browser and the WinForms label has changed without a single PostBack!


Does this work in FireFox?

Well, Visual WebGui supports the major browsers as you can see in the following image.

The source code for this post can be found here...

About the author

Related Articles

Introduction  
Title Update Author
Silverlight controls
Tags: Developers, 1. Beginner, 2. Intermediate, 3. Advanced, Silverlight, Pre v6.3, v6.3
07/Jan/2008    2008/01/07
In this “How To” we are going to learn how to use Visual WebGui open source project to create a code patch fixing a bug you have found or a feature you have created and would like to add.
Tags: Developers, 3. Advanced, Customization, Pre v6.3, v6.3, v6.4 and Later
07/Jan/2008    2008/01/07
Tags: Developers, Data Binding, Navigation, 1. Beginner, 2. Intermediate, Data Binding, Navigation, ASP.NET, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
11/Jan/2009    2009/01/11
Abstract: The Web, Cloud and SaaS models are changing the computing world forever, and us, the developers will have to adjust and serve this trend. One of the biggest challenges is moving software assets that were developed for desktop architecture to the new deployment models. Just imagine that you...
Tags: Architects, CIOs, Developers, C#, 1. Beginner, 2. Intermediate, 3. Advanced, Windows Forms, Pre v6.3, v6.3, v6.4 and Later
07/Jan/2010    2010/01/07
In this How to we are going to learn how to develop a Visual WebGui application without the use of a form designer.
Tags: Developers, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
02/Jan/2009    2009/01/02
Tune in to this Free webcast and learn how Visual WebGui solves all the pains of Rich Internet application development. Learn how Visual WebGui bridges between the richness of .NET and the richness of HTML5. Learn how to be empowered by Visual WebGui to build rich enterprise-level Ajax based Web and...
Tags: Architects, Developers, Data Binding, Drag & Drop, Visual WebGui Pipeline, C#, CSS, HTML5, JavaScript, Visual Studio, XML, 1. Beginner, 2. Intermediate, 3. Advanced, Customization, Data Binding, Layouting, HTML5, jQuery, v6.4 and Later
30/May/2011    2011/05/30
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS