Recent

Author Topic: Form not displaying properly in other PCs  (Read 902 times)

ranny

  • Jr. Member
  • **
  • Posts: 64
Form not displaying properly in other PCs
« on: January 31, 2023, 04:24:10 pm »
Hello,

It has been a while since I was last using this forum which helped me a lot before.  I am back now with a problem I do not know where to start with.

I have compiled a program that has one main form mostly taken up with a tabbed pagecontrol which has three stringrids and two charts across the tabs.  For the stringgrids I have adjusted the column widths to encapsulate the header row text nicely, at runtime, and it looks perfect when run on my PC.  When it runs on other PCs, there is a change to "something" like text size or similar that makes the size of the columns, or the overall stringgrid, change such that scrollbars appear at the side and bottom of the stringrid.  Today whilst trying to demonstrate to other users I noticed that there is a simple label that wont display the text properly and I am noticing scales on my charts seem cluttered and unreadable.

My monitor is widescreen and the scaling in the display properties is 100%.  I am trying to get info from my colleagues as to their display settings on their PCs or laptops, but I can say that I have not experienced this before with other programs I have created and used on different machines.

I am not able to produce a screen shot of this at the moment as the forms have commercially controlled company information, if need be I will remove this if it helps.

Thanks in advance.

Ranny

« Last Edit: February 02, 2023, 09:57:58 am by ranny »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Form not displaying properly in other PCs
« Reply #1 on: January 31, 2023, 05:43:47 pm »
Not everyone uses 96 dpi settings so u need to design your app to adjust at runtime.

Using anchors works well and there is scaling functions
The only true wisdom is knowing you know nothing

dseligo

  • Hero Member
  • *****
  • Posts: 1194
Re: Form not displaying properly in other PCs
« Reply #2 on: January 31, 2023, 08:06:57 pm »
What do you have in Project options/Application, 'Use LCL scaling (Hi-DPI)' and 'DPI awareness'? See attachment.

On what OS is that? What Lazarus version?

It would be more clear if you included 'wrong' and 'right' screenshots (problem screen and how it should look).

ranny

  • Jr. Member
  • **
  • Posts: 64
Re: Form not displaying properly in other PCs
« Reply #3 on: February 02, 2023, 09:56:37 am »
Thanks for the comments.

Jamie - I don't know where to start with anchors, scaling functions that can be changed at runtime.  Is there anywhere  I can look for such info?

dseligo - my settings are as per your image in my application.  As I said in my original post, the data on the form is commercially sensitive however i have taken snapshots of the problem with the stringgrid which is the main issue.  See attached.  I did find out that one of my colleagues has his settings at 250% for "Change the size of text, apps and other items" in the display settings, cannot think why anyone would have this setting.

Any advice is much appreciated.

Ranny

af0815

  • Hero Member
  • *****
  • Posts: 1288
regards
Andreas

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Form not displaying properly in other PCs
« Reply #5 on: February 02, 2023, 12:18:43 pm »
At which ppi settings is the "not okay" screenshot taken? It is magnified to about 213% - a bit strange number...

Be careful with changing the "resolution" in Win-11. There are two ways to do it, LCL scaling works only with one of them:

- System > Screen > Scaling and layout > Scaling: I can choose between 100% (recommended), 125%, 150% and 175% - this is where LCLScaling is active: Check "Use LCLScaling" and "Use manifest resource" in the project options, and set "DPI awareness" to something different from "off". There are settings in "DPI awareness" which also allow a per-monitor scaling in case of multi-monitor systems.

- Accessibility > Text size -- this only increases the text size, but does not change the screen resolution; this is not handled by LCLScaling. You should anchor the controls to each other so that they reposition themselves when text size changes. And use AutoSize=true as much as possible.
« Last Edit: February 02, 2023, 01:03:20 pm by wp »

ranny

  • Jr. Member
  • **
  • Posts: 64
Re: Form not displaying properly in other PCs
« Reply #6 on: February 08, 2023, 12:13:37 pm »
Thanks to you all for your comments.  I am on another project at the moment and will return to this soon.

I will update on success (or not) !

Cheers.

 

TinyPortal © 2005-2018