How to get text to fit inside a button

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!
 
R

rhaazy

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.
 
F

Fernando

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top