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
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:
1 2 3 4 5 |
#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.
- Deploying to a production environment
The simplest way to deploy a Window Forms application to a production environment is to use smart client deployment. If you cannot or do not want to use smart client deployment, use the following procedure to install the application. - System Requirements for .NET Windows Forms Targets
You must install version 2.0, 3.0, or 3.5 of the Microsoft .NET Framework on the same computer as PowerBuilder. For intelligent update applications, you must also install the .NET Framework 2.0, 3.0, or 3.5 SDK (x86). - Creating a .NET Windows Forms Project
You can create a project to deploy the application in the target wizard or by using the .NET Windows Forms wizard on the Project page of the New dialog box. - Deployment of a Windows Forms Application
When a .NET Windows Forms project is open in the Project painter, you can select Design Deploy Project or the Deploy icon on the PainterBar to deploy the project. - Project Execution
After you deploy the application, you can run it by selecting Design Run Project from the Project painter menu or selecting the Run Project toolbar icon from the Project painter toolbar.