The .NET and WPF environments affect the behavior of several PowerBuilder controls at runtime.
This table highlights some of the important changes to the runtime behavior of PowerBuilder controls in WPF applications:
Control property or functionality | PowerBuilder Classic behavior | PowerBuilder .NET behavior |
---|---|---|
All controls focus sequence when current control has a TabOrder value of 0 | Pressing Tab or the Shift+Tab keys changes focus to the control with the lowest TabOrder value (other than 0). | Pressing Tab changes focus to the control with the lowest TabOrder value (other than 0), but pressing Shift+Tab changes focus to the control with the highest TabOrder value. |
DatePicker background and text colors | Properties are not available to set the colors in the text box part of the control. The CalendarBackColor and CalendarTextColor properties set the colors in the drop-down calendar part of the control. | BackColor and TextColor properties set the colors in the text box part of the control, and the CalendarBackColor and CalendarTextColor properties set the colors in the drop-down calendar part of the control. |
DatePicker font size | You cannot save negative font sizes at design time, but positive font sizes are saved as negative values. If positive values are set at runtime, the actual text size for the text box part of the control is converted from PowerBuilder units to units for a logical device (such as a screen), and is relatively smaller than the actual font size that appears when you set the same values preceded by a minus sign. However, this calculation is not performed for the calendar part of the control, where text sizes appear as they would if the set values were preceded by a minus sign. | As in PowerBuilder Classic, you cannot save negative font sizes at design time, but positve font sizes can be saved as positive values if you set these in the XAML editor. At runtime, PowerBuilder .NET uses the same calculation for converting positive values as PowerBuilder Classic, but the converted values apply to both the text box and calendar parts of the control. For more precise font sizes that do not depend on unit conversion, you can set negative values at runtime. |
DatePicker ValueChanged event | Date entry by user triggers event automatically. | User must press Enter key or change focus before the event can be triggered. |
EditMask default mask when decimal mask is invalid | No default mask. Behavior is undefined. | EditMask uses ##,###.## as its default mask. |
EditMask empty mask for Date, Time, and DateTime datatypes | Uses static masks: dd/mm/yyyy, hh:mm:ss:fff, and dd/mm/yyyy hh:mm:ss:fff. | Uses masks based on the culture set for the runtime operating system. |
EditMask with percent sign in mask string | The percent sign is appended to any numeric value entered. For example, for a 0.00% mask, if you set the Text property to 5, the resulting value is 5.00%. | The numeric value set for the Text property is first multiplied by 100 before the percent sign is added. For a 0.00% mask, if you set the Text property to 5, the resulting value is 500.00%. This matches the behavior of DataWindow edit formats that change calculated decimal values into percentages. |
Graph control availability | Standalone graph controls can be placed on any window or user object, as well as in DataWindow objects. | Graph controls are supported in the DataWindow painter only. By default, there is no WPF Graph control in the Toolbox for inclusion on WPF windows or visual user objects. Although you can migrate PowerBuilder Classic, applications with independent Graph controls, the Graph controls do not appear in WPF applications, and calls to these controls do not work. |
GroupBox assembled controls | Controls that are inside a GroupBox belong to the container of the GroupBox. | Controls that are inside a GroupBox belong to the GroupBox and not to the container of the GroupBox. If you make the GroupBox invisible at runtime, its inner controls will also be invisible. |
Menu focus | Menus are dependent on windows or other container objects, and do not gain or lose focus. The MenuFocusable property has no meaning in PowerBuilder Classic. | Menus are independent controls in PowerBuilder .NET. By default, if a WPF control has focus when you click a menu item, the LoseFocus event of the control is triggered, and if you make a menu selection that returns focus to the WPF control, the GetFocus event of the control is triggered. You can prevent these events from being triggered by setting the MenuFocusable property to false. However this also prevents application users from being able to scroll through the menu using arrow keys. |
MonthCalendar SetDateLimits function | Makes dates outside the limits unselectable. | Makes dates outside the limits invisible. |
MonthCalendar DateSelected event | Clicking in blank area of control does not trigger event. | Clicking in blank area of control triggers event. |
MonthCalendar RButtonDown and GetFocus events | Right-clicking a MonthCalendar that does not have focus triggers only the RButtonDown event. | Right-clicking a MonthCalendar that does not have focus triggers the RButtonDown and GetFocus events. |
RichTextEdit Selected Text Object dialog box | Users can format selected text through selections in the Selected Text Object dialog box. | RichTextEdit controls take advantage of WPF functionality to render rich text. Although the Selected Text Object dialog box is not available to application users, they can still modify the format of selected text from the control toolbar at runtime. |
Tab control TabPosition values | TabPosition values and meaning:
|
TabPosition values and meaning:
|
TabPage control header | Tab pages appear in a single line. | When there are several tab pages, they may appear in more than one line. This can affect the appearance of controls in a tab page. |
Window MDI appearance | MDI windows appear as sheet windows, except in .NET Web Forms targets, where they appear as tabbed documents. Sheet windows can be arranged in layers, in vertical or horizontal tiling patterns, or in cascades. | MDI windows appear as tabbed documents. |
Window MDI behavior | If there is a position parameter in the OpenSheet call, sheet windows are added to the specified menu item when they are opened. Users can select the sheet window they want to access from that menu. | If the user opens enough tabs that they do not fit in the frame window, there is a drop-down menu on the right-hand side that allows the user to select a sheet. |
Window Resize event | Calling the window Hide function does not affect the Resize event. | Calls to the Hide function causes a window to lose focus, and a subsequent Resize event fails. You must remove Hide and Show scripts to trigger the Resize event successfully. |
For behavior changes in DataWindow Runtime controls, see Behavior Changes for DataWindow Objects.