PowerBuilder Windows Forms Applications

PowerBuilder applications with a rich user interface that rely on resources of the client computer, such as a complex MDI design, graphics, or animations, or that perform intensive data entry or require a rapid response time, make good candidates for deployment as Windows Forms applications.

For a comparison of design considerations between Web Forms and Windows Forms applications, see Choosing a .NET Application Target.

Adapting an existing application

The changes required to transform a PowerBuilder application into a Windows Forms application depend on the nature of the application, the scripting practices used to encode the application functionality, and the number of properties, functions, and events the application uses that are not supported in the .NET Windows Forms environment.

For a list of restrictions, most of which apply to both Windows and Web Forms applications, see Best Practices for .NET Projects.

For tables of unsupported and partially supported objects, controls, functions, events, and properties, see Unsupported Features in Windows Forms Projects.

Setting up a target and project

You set up a target for a .NET Windows Forms application using the wizard on the Target page of the New dialog box. You can start from scratch and create a new library and new objects, use an existing application object and library, or use the application object and library list of an existing target.

You define some of the characteristics of the deployed application in the .NET Windows Forms Application wizard. Additional properties are set in the Project painter. See Properties for a .NET Windows Forms Project.

Smart client applications

One of the choices you can make in the wizard or Project painter is whether the application will be deployed as a smart client application. A smart client application can work either online (connected to distributed resources) or offline, and can take advantage of “intelligent update” technology for deployment and maintenance. See Intelligent Deployment and Update.

Deploying from the Project painter

When you deploy a PowerBuilder application from the .NET Windows Forms Project painter, PowerBuilder builds an executable file and deploys it along with any PBLs, PBDs, resources, .NET assemblies, and other DLLs that the application requires. See Deployment of a Windows Forms Application.

Using preprocessor symbols

If you share PBLs among different kinds of target, such as a target for a standard PowerBuilder application and a Windows Forms target, you might want to write code that applies to a specific target. For example, use the following template to enclose a block of code that should be parsed by thepb2cscode emitter in a Windows Forms target and ignored by the PowerScript compiler:
   #if defined PBWINFORM then
	     /*action to be performed in a Windows Forms target*/
   #else
	     /*other action*/
   #end if

You can use the Paste Special>Preprocessor context menu item in the Script view to paste a template into a script.

For more information about using preprocessor symbols, see Conditional Compilation.