Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Font in Form becomes too large

Status
Not open for further replies.

dlare9

Programmer
Apr 3, 2007
12
JP
Hi again,

I don't know if anyone have experience this, but some of my label becomes too large that it exceed my form . This Happens when I change my font size in my display properties to "large" and "extra large".

Is there a way to make my label to adjust depending on the system font size?

my OS is WinXP and I'm using BCB v6.


thanks,
gerald
 
Forgot to mention that the buttons in my forms are somewhat misplaced and can't be shown completely no matter what adjustment to the form I make.

Regards,
gerald
 
Well, if it's a matter of knowing the width and height of the text in the label and then adjust position then you can get those values like this:

char Buffer[100]; // Well, whatever size or constant
sprintf(Buffer,"This is a test"); // Demo just to fill in
int Width = FormX->Canvas->TextWidth (Buffer);
int Height = FormX->Canvas->TextHeight(Buffer);

It should be possible to use:
int Width = FormX->Canvas->TextWidth (Label->Caption.c_str());
int Height = FormX->Canvas->TextHeight(Label->Caption.c_str());
but i haven't tried it.

Totte
Keep making it perfect and it will end up broken.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top