Board index » cppbuilder » Relationship between font size and window size

Relationship between font size and window size

The windows of my program display normally in my PC. But in other computer
that different desktop apperance (different font definitions), the window
sizes change, and texts on these windows diplay outside.
What can I do? Thanks.
 

Re:Relationship between font size and window size


If your App Window is just like a dialog box then design your Window under
small font system and set the Window boarder style to bsDialog or
bsTooWindow. Other wise you should resize your Window manually according to
the font.

Regards,
            Binzhong

Quote
"Owen 163" <owen-...@163.net> wrote in message news:3c1ec2ab$1_2@dnews...
> The windows of my program display normally in my PC. But in other computer
> that different desktop apperance (different font definitions), the window
> sizes change, and texts on these windows diplay outside.
> What can I do? Thanks.

Re:Relationship between font size and window size


Thanks.
But, what's the exact relationship of window size and font size?
Quote
"Binzhong Zhou" <Binzhong.Z...@dem.csiro.au> wrote in message

news:3c1ecf89_2@dnews...
Quote
> If your App Window is just like a dialog box then design your Window under
> small font system and set the Window boarder style to bsDialog or
> bsTooWindow. Other wise you should resize your Window manually according
to
> the font.

> Regards,
>             Binzhong

> "Owen 163" <owen-...@163.net> wrote in message news:3c1ec2ab$1_2@dnews...
> > The windows of my program display normally in my PC. But in other
computer
> > that different desktop apperance (different font definitions), the
window
> > sizes change, and texts on these windows diplay outside.
> > What can I do? Thanks.

Re:Relationship between font size and window size


Quote
"Owen 163" <owen-...@163.net> wrote in message news:3c1ec2ab$1_2@dnews...
> The windows of my program display normally in my PC. But in other computer
> that different desktop apperance (different font definitions), the window
> sizes change, and texts on these windows diplay outside.
> What can I do? Thanks.

Stretching or Shrinking of a Form is based on the height of Font which
is specified by Form's Font property.

1. At design time, Form save the height of font by using
  Canvas.TextHeight Method into the Form File.
  Form also save Logical Inch.
2. At run time, Form look at the logical Inch and Compare
   with saved one.
3. If Different, and Scaled property = True, Form change the Height of Font.

   Font.Height = FontHeight * NewLogical Inch / Old Logical Inch.

4. After Changing Font.Height property, Form get new Font Height

   NewFontHeight = Canvas.TextHeight

5. Form Stretch or Shrink Everything by unsing Scale Factor

    Scale Factor = NewFontHeight / Saved Old Font Height

   If AutoScroll property = true, the size of th form is not resized,
   but controls and fonts are resized.

Other Threads