The .NET Platform
Development Tools
COM & COM+
Data Access
Web Development
XML Technologies
Windows Servers
Wireless & Mobile
Security issues
Design & Process
Career Development
Analysis & Comment
Disposable Objects
You are not logged in: login here to access all areas.
For those building Windows Forms applications, .NET Framework 2.0 brings a range of new controls and ClickOnce deployment technology. Alex Homer explains.
Author: Alex Homer
Last updated: May 2005
While ASP.NET provided an obvious advantage in upgrading for Web developers, many Visual Basic 6.0 developers did not consider that the Windows Forms technology in .NET offered such compelling reasons to upgrade. However the advent of the C# programming language and the modernization of Visual Basic within the .NET Framework does provide plenty of opportunities to write better and more compact code. Other new controls include a MaskedTextBox and a new WebBrowser control that allows you to build Web-enabled applications. Also, to make your applications look more like the current generation of Windows applications, there is the new ToolStrip control for creating menus, toolbars, and status bars: Furthermore, the Windows Forms developer will benefit from the many improvements and new features in the latest version of Visual Studio 2005. These are discussed in detail in our article on Visual Studio 2005. ClickOnce Deployment Once this is done, users can go to the new Web page that is created, and simply click a link to install the application: The ClickOnce technology supports both online and offline launching of applications. Online applications are run directly from the published location, whereas offline applications are installed and run on the client machine. An offline application installation includes a Start menu entry and is added to the ‘Add/Remove Programs’ dialog. These types of applications are also installed on a per-user basis - in other words, they are only visible to the current user, and do not require administrative rights for installation. Furthermore, the publish location doesn't have to be a Web server - you can use ClickOnce with network shares, the file system or CD-based installation files. However, the Web is where the benefits are really profound. Find out more
Version 2.0 of the .NET Framework offers the Windows Forms developer several new controls. These include the DataGridView which provides a much better way to display and allow editing of data rowsets. It allows row sorting, editing (including adding new rows) and deleting to be accomplished inline, as well as permitting users to re-order columns:

One of the main issues facing Windows Forms developers - and indeed all executable application developers - is the problem of getting your application installed and enabled on the client machine. The Windows operating system supports deployment of applications throughout a domain or local network, but this is no help in deploying into a wider context. The obvious solution, of course, is to be able to deploy Windows Forms applications across the Internet.
In Version 2.0, the .NET Framework supports a new feature called ClickOnce that provides Internet and Intranet-enabled application deployment. You simply create your application in the usual way, in Visual Studio 2005, and then select ‘Publish’ from the Project menu. This display the Wizard shown below which collects the information required to publish the application through a Web server:

Once installed, depending on the options you set when you publish the application, it can automatically check for updated versions at the original publish location. This means updating an application becomes simply a matter of updating the published file on the Web server. Application deployments take advantage of HTTP compression to minimize download times. They can also take advantage of incremental downloads, and install individual assemblies only when required.
Of course, as with any downloadable code, a major issue with ClickOnce is security. The browser prompts with a security warning when you attempt to install a ClickOnce application, and once installed, runs the application inside a sandbox implemented by the CLR Code Access Security system. If required, you can configure different trust levels or require administrative deployment and installation.
The Windows Forms Web site at http://www.windowsforms.net/articles/windowsformsoverview.aspx contains a host of useful information, including forums, article, and downloads. For an example of using the WebBrowser control, see http://msdn.microsoft.com/library/en-us/dnvs05/html/browserexpress.asp. For more details of the ClickOnce deployment model, see http://msdn.microsoft.com/library/en-us/dnwinforms/html/clickonce.asp.
Click here for our Privacy Statement. Copyright © Matt Publishing. All rights reserved. No part of this site may be reproduced without the prior consent of the copyright holder.