1. Steen Jakobsen
  2. PowerBuilder
  3. Friday, 26 June 2020 05:22 AM UTC

Hi,

How do I Center the title text of a main window ?

It seems that the title text is always justified left.

 

I'm using PB2019 R2 /Windows 10

 

Thanks 

Steen :-)

 

Sivaprakash BKR Accepted Answer Pending Moderation
  1. Thursday, 2 July 2020 05:50 AM UTC
  2. PowerBuilder
  3. # 1

With no role of ours, in a client's computer the title is CENTERED.  In all other places the title is left aligned.  We are trying to find out the settings that makes this change, not succeeded.  Should be some settings in the windows, as we have done nothing to center it and also in all other places, it is left aligned.  

 

Comment
There are no comments made yet.
Brad Wery Accepted Answer Pending Moderation
  1. Friday, 26 June 2020 19:44 PM UTC
  2. PowerBuilder
  3. # 2

As mentioned in another post, Ultimate Suite has window objects that allow you to do this:

https://www.pbultimatesuite.com/EN/modernize-pb-interface/single-page-application.html

Comment
  1. Steen Jakobsen
  2. Thursday, 2 July 2020 03:58 AM UTC
Thanks. But the price tag is much much to high :-)
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 26 June 2020 16:32 PM UTC
  2. PowerBuilder
  3. # 3

Hi Steen;

  As John correctly stated, it's an MS-Windows O/S controlled area and always left justified.

  However, with a little creative PowerScripting on the ReSize event to Left Pad the title with spaces you should be able to "emulate" the centering. Just take the NewWidth argument value and calculate the Title Text length to compute the number of Space(nn) values that you need for padding.

Food for thought. HTH

Regards ... Chris

Comment
  1. Steen Jakobsen
  2. Thursday, 2 July 2020 03:57 AM UTC
Thanks Chris :-)



It works to some extent by padding but the number of chars is limited.

Thanks anyways



ps. I think a nice enhancement to PB would be to customize the title bat just like the MS Office applications.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 2 July 2020 11:57 AM UTC
Hi Steven;

Please feel free to create a support ticket for this feature as an enhancement request.

Regards ... Chris
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 26 June 2020 14:10 PM UTC
  2. PowerBuilder
  3. # 4

Greetings, Steen - 

The text in a window title (the Windows O/S refers to this as the "caption") is left-justified because that is the default style as defined by Windows. There is an extended window style bit for right-justified, but there is no window style or extended window style bit for centering the caption that I could find in the Windows API documentation.

If you know of an application that does this, the app is likely rendering its own title/caption area.

Regards, John

Comment
  1. Steen Jakobsen
  2. Thursday, 2 July 2020 03:58 AM UTC
Thanks John :-)



But I have given up.. . I think a nice enhancement to PB would be to customize the title bat just like the MS Office applications.
  1. Helpful
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.