How to get text to fit inside a button

  • Thread starter Thread starter Steve_H
  • Start date Start date
S

Steve_H

Hi, I'm working with Visual Studio C# 2008 Express and I'm having the
hardest time trying to get an 8.25f Microsoft Sans Serif font in a
70x18 pixel (width x height) FlatStyle.Popup button. The text just
won't center to fit inside the button. The font gets chopped off at
the bottom (because it doesn't want to perfectly center itself).

Can someone else out there just try this to see what I mean? There's
plenty of room in that button to fit that size text and it would save
a lot of space in my app as I need several columns of these size
buttons.

It's just a Windows Forms App compiling to whatever Framework version
Express defaults to (the latest, I presume).

Thanks for the help!
 
Hi, I'm working with Visual Studio C# 2008 Express and I'm having the
hardest time trying to get an 8.25f Microsoft Sans Serif font in a
70x18 pixel (width x height) FlatStyle.Popup button.  The text just
won't center to fit inside the button.  The font gets chopped off at
the bottom (because it doesn't want to perfectly center itself).

Can someone else out there just try this to see what I mean?   There's
plenty of room in that button to fit that size text and it would save
a lot of space in my app as I need several columns of these size
buttons.

It's just a Windows Forms App compiling to whatever Framework version
Express defaults to (the latest, I presume).

Thanks for the help!

change the size of your button.
 
Did you set the AutoSize property? The button will have the right dimensions
for the text .
As for the opposite i dont know, maybe selecting a smaller font.

bye.
Fernando
 
Back
Top