Board index » cppbuilder » Font size and component size

Font size and component size

What relation there should be between the Windows character size (Small or Large)
and the positioning and size of a component inside a form ? IMHO none, but
apparently BCB4 has a different view.

I created a simple test case, where I put a PaintBox inside a form, setting the Top
property to 40 pixels and the Height property to 150 pixels. This with Windows set
for Small Fonts.

Then I saved the project, switched to Large Fonts using the Display Settings of
Windows, rebooted, reopened the project and, surprise, the Top property now
was set at 49 pixels, and Height to 182 pixels.
I don't understand this behaviour.
And this is not an accademic question. Some of the users of a my program reported
the clipping of the main window, and, upon investigation, all of them were using
Large
Fonts.

Is there a parameter, somewhere, to tell BCB4 to, please, not change the relative
positioning and size of the components I put in my form ?  Thanks for any
suggestions.

Alberto di Bene

 

Re:Font size and component size


Hello Alberto,

Alberto di Bene <dib...@usa.net> schreef in berichtnieuws
38511FC1.4C3B4...@usa.net...

Quote
> What relation there should be between the Windows character size (Small or
Large)
> and the positioning and size of a component inside a form ? IMHO none, but
> apparently BCB4 has a different view.

[ snip ]

Well, this is an issue that comes up from time to time<g>, and there's no
simple solution for this behaviour. There exists a component that is said to
handle this very well called TSizer (or an alike name) but I never seen it
since it's payware<g>.

Quote
> Is there a parameter, somewhere, to tell BCB4 to, please, not change the
relative
> positioning and size of the components I put in my form ?  Thanks for any
> suggestions.

Have a look at the PixelsPerInch and Scaled properties of the TForm. The
initial value of PixelsPerInch can give you a clou whether large or small
fonts are in use on the current system and Scaled set to false should
prevent the vcl to change sizes on different platforms (with large or small
fonts). Also I think there is a faq on this issue on Harold Howe's website
www.bcbdev.com

Hope this helps a bit...;-))

Quote
> Alberto di Bene

--
Greetings from overcast Amsterdam

                Jan

email: bijs...@worldonline.nl
http://home.worldonline.nl/~bijster

Re:Font size and component size


Quote
"J.A. Bijsterbosch" wrote:
> Hello Alberto,

> Well, this is an issue that comes up from time to time<g>, and there's no
> simple solution for this behaviour. There exists a component that is said to
> handle this very well called TSizer (or an alike name) but I never seen it
> since it's payware<g>.

Jan,
           thanks for your suggestions. Will try if they can be of help.

Daag (my wife is Dutch, so I know a few Dutch words :-)

Alberto

Other Threads