Board index » cppbuilder » system font size and appearence of forms ??

system font size and appearence of forms ??

    The appearence of my program changes depending on whether the windows
font size property (in display properties) is set to "Large Fonts" or "Small
Fonts".
    I have played with the "scaled" property and some others to try and get
a consistent display but nothing is making any difference. I have searched
the web and not found any useful references to what must be an easy problem
to fix - what setting in BCB 4 do i need to adjust to get around this very
annoying behaviour ??

Thanks in advance,
James

 

Re:system font size and appearence of forms ??


OK so I found the autosize property just after sending the first post.   The
question is how do I apply it globally, at design time,  through out my
application when I have some 300 labels ??   Is there a way to select all
labels in a project for example ???

Thanks once again,
James

Quote
>     The appearence of my program changes depending on whether the windows
> font size property (in display properties) is set to "Large Fonts" or
"Small
> Fonts".
>     I have played with the "scaled" property and some others to try and
get
> a consistent display but nothing is making any difference. I have searched
> the web and not found any useful references to what must be an easy
problem
> to fix - what setting in BCB 4 do i need to adjust to get around this very
> annoying behaviour ??

> Thanks in advance,
> James

Re:system font size and appearence of forms ??


Quote
> how do I apply it globally, at design time

For large projects, I usually do the following: right-click the form,
select View as Text, make a text replacement.

--
Yoto Yotov

Re:system font size and appearence of forms ??


Quote
>     The appearence of my program changes depending on whether the windows
> font size property (in display properties) is set to "Large Fonts" or "Small
> Fonts".

Harold Howe's definitive posting on the subject:

In general, try to stay in one of these camps

Camp A, the better camp:

Design your program with small fonts
Set Scaled to true for the form
Set AutoScroll to false
Set BorderStyle to bsDialog or bsSingle

I'm not sure if the font thing that ZDTips talked about is necessary, but it
won't hurt. Using custom fonts will only get you into trouble anyway when
you run the program on a machine that doesn't have that font.

With this strategy, the BorderStyle is critical. When Scaled is true,
controls expand by a ratio of 120/96 when run on a large font machine. When
BorderStyle is bsDialog or bsSingle, the size of the form also grows.
However, if you use bsSizable, the form does not grow. When this happens,
the resized controls fall of the edge of the form. This is why the form
displays the ugly scroll bars. If you must use bsSizable, adjust the Height
and Width of the form if you detect Large fonts, see my FAQ at

http://www.bcbdev.com/faqs/faq25.htm

Note, if you run into trouble with labels, follow these suggestions. If
single line labels get chopped off, try setting AutoSize to false for the
label. Then widen the label by a factor of 120/96 or more. This gives the
text room to grow. For multi line lables, set autosize to false, keep
WordWrap to true, and expand the Height of the label so it has a spare line
or two. This allows the text to grow and fill up the rest of the label. At
small fonts, these labels will seem farther apart than they do to a user
running a large fonts.

Also note, designing at small fonts means that you have to deal with
problems of forms that expand when run on a large font machine. The problems
that are caused by expanding forms are probably easier to deal with than
forms that shrink, which is what happens when you design at large fonts and
run at small fonts.

Camp B

Design using small fonts
Always set Scaled to false
Set AutoScale to false

This essentially turns off all scaling and leaves it up to you. It also
tends to cause as many problems as it solves.

Camp C

Tell users of Large fonts to take a hike. This isn't always practical, but
where I work, it is :) Because Visual C++ and MFC are no better at dealing
with fonts (in fact they're worse), our IT department has specified that our
programs (both MFC and BCB programs) will function correctly at 800x600, 16
bit high color, small fonts. If your not running that, don't complain (I
didn't make these rules by the way, but I don't seek its abolishment
either). If your software ends up on a shelf at compusa, this strategy might
not be wise.

Harold Howe (TeamB)
http://www.bcbdev.com

+=====================================================+
| Jonathan Arnold (mailto:jdarn...@buddydog.org)      |
|         Comprehensive C++Builder link site:         |
| http://www.buddydog.org/C++Builder/c++builder.html  |
+=====================================================+

Other Threads