1. Moritz Venn
  2. PowerBuilder
  3. Thursday, 30 August 2018 09:20 AM UTC

Hi,

 

we are in the process of upgrading our products and migrating them to powerbuilder 2017.

In this process we noticed that on Windows 10 Systems the MDI ChildFrames have old XP-style Borders which do not match the remaining UI in either Windows or our Application.

The Borders can be influenced by activating high contrast mode in Ease of Access, but those are System wide Settings and we can't exactly force our customers to activate it for a visually pleasing UI.

This issue is also present with PowerBuilder 12.6. While static, the default border style in Windows 8.1 is not as out-of-place as the XP style in Windows 10.

 

Is there anything we can do to fix this, can this only be fixed in PowerBuilder or-even worse-does is require changes on Microsofts end?

 

Regards,

 Moritz

Ronnie Po Accepted Answer Pending Moderation
  1. Thursday, 30 August 2018 16:15 PM UTC
  2. PowerBuilder
  3. # 1

Hi Moritz,

You should be able to remove the border from the MDI client area using Windows API function calls.

Here are the steps that worked for me:

// 1
// Declare global or instance (in your frame window object) constants
// Win API constants
constant long GWL_EXSTYLE = (-20)
constant long WS_EX_CLIENTEDGE = 512
 
// 2
// Declare External Functions (local or global) - these declarations are for ANSI
// For Unicode, replace the A at the end of the function names with W
function long GetWindowLongA (long hWindow, integer nIndex) Library "user32.dll" 
function long SetWindowLongA (long hWindow, integer nIndex, long dwNewLong) library "user32.dll" 
 
// 3
// Code the following in the open() event of the MDI frame window, or somewhere in your open sequence
// You'll need to perform bitwise operations; the PFC has functions that can help
long ll_winStyle
 
// Remove MDI client area border
// Use PFC numerical service for bitwise operations
n_cst_numerical inv_num
ll_winStyle= GetWindowLongA(Handle(mdi_1), GWL_EXSTYLE)
ll_winStyle = inv_num.of_bitwiseAND(ll_winStyle, inv_num.of_bitwiseNOT(WS_EX_CLIENTEDGE))
 
SetWindowLongA(Handle(mdi_1), GWL_EXSTYLE, ll_winStyle)
 
 
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 30 August 2018 13:00 PM UTC
  2. PowerBuilder
  3. # 2

Hi Moritz;

   In your App's "project" object, did you set the "XP Style" on or off for the EXE compilation?

Regards ... Chris

Comment
  1. Roland Smith
  2. Thursday, 30 August 2018 15:00 PM UTC
He is talking about the border of the mdiclient area. The window painter has a property to set the mdiclient color but not the border. It always is 3D Lowered. There should be a boolean border property like on other controls. If false, it would be flat. Then we could set the color to match the window and it would have the Win10 flat look like non-mdi windows.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 30 August 2018 15:10 PM UTC
Thanks Roland. Yes, that would be a nice feature to have as PB App's move forward into newer MS-Windows releases.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 30 August 2018 12:53 PM UTC
  2. PowerBuilder
  3. # 3

It would be helpful if the mdiclient control had a border property like other controls. You should suggest it as an enhancement in the support area.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.