[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How do I control the text padding and spacing in a button?

Posted on 2007-07-30
Medium Priority
Last Modified: 2010-04-23
VS 2005

I am adding a button with elipses (...) in it to a form.  VS is making me size the button much larger than I want it though just to show the three periods.  The button has to be about three times as wide as the three periods actually are.  I have set the padding to all zeros.  It dowsn't look like the margin is relevant.  Is there something else that I can do to reduce all the extra space in the button?


Question by:Todd_Anderson

Expert Comment

ID: 19597162
Is AutoSize on?
If it is turn it off and adjust the Width propert of the button.

Author Comment

ID: 19597680
AutoSize is off.  I did adjust the width.  Slowly, pixel by pixel until all three periods were showing.  But when I get it wide enough to show all three periods there is a lot of space to the left and the right.  Wish I could post a screen shot.
LVL 96

Accepted Solution

Bob Learned earned 252 total points
ID: 19598814
Is this font size sufficiently small enough?   Fonts like Arial have narrow characters, and might help.

LVL 34

Assisted Solution

Sancler earned 248 total points
ID: 19598976
Try setting

        myButton.FlatStyle = FlatStyle.System

You can do it either in design mode or in code on Form_Load


Author Comment

ID: 19600707
Thanks for the help.  Here's my final solution.

Change the font to Arial
Cahnge the FlatStyle to System
Remove the bold font style

This allowed me to reduce the size from 27 pixels to 17 pixels.  I did them each separately and they are each responsible for about one third of the change.  Exactly what I wanted.  The button looked bulky before and stuck out.  Now it looks streamlined and fits with the standard Windows look.



Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question