Adding Resources to a Target

When you create a new target in PowerBuilder .NET, you can use the Select Resources page of the new target wizard to include resources such as pictures or text files. After the target is created, you use the context menu items on the target or its subfolders to include new or existing resource files.

The new target wizard adds the resources and resource directories you select on its Select Resources page to a Resources folder under the target directory. If you do not use the wizard to create a Resources folder, you can add resources directly to the target directory, or you can add a folder under the target directory to contain the resource files that you add.

Note: Resources are external to the target in PowerBuilder Classic, but not in PowerBuilder .NET. When you migrate an application and select its resource files or directories in the new target wizard, the resource files are copied relative to the new target path, based on their location relative to the original target.

If the application that you migrated did not reference the resource files relative to the target location (for example, in a path relative to the Application object, when that is not the same as the target location), you can drag and drop the resource directory to the correct location in the Solution Explorer after migration.

You can drag and drop resource files or directories from the Windows Explorer directly onto the target object or a folder under the target object in the Solution Explorer, or you can use this procedure:

  1. (Optional) Right-click the target object in the Solution Explorer, select New Folder, then type a name for the folder.
  2. Right-click the new folder or the target object, and select:
    Option Description
    Add New Item Select the type of resource you want to add, click Add, then double-click the new item in the Solution Explorer to edit the new object in its associated editor.
    Add Existing Item Select the file for the resource you want to add, and click Add. You can view or edit the object by double-clicking it in the Solution Explorer.
    If you right-click a folder, the item you add is included under the folder; if you right-click the target, the item you add is included in the target directory. Either way, the resource item is deployed and available to the target when you build a target project.