?
Solved

Visual Studio 2010 - Looking for a margin inside Textbox

Posted on 2012-03-14
2
Medium Priority
?
3,447 Views
Last Modified: 2012-03-15
I've got a form with a textbox in it and the text butts right up against the border. It looks very unprofessional but I can't figure out a way to add padding on the left or right.

Screenshot. Note the text right up against the border.
I see the Margin property, but I've tried changing it from the default of 3 all the way up to 25 with no affect. But, the HELP seems to suggest Margin is space BETWEEN controls, not for the text within it.

The textbox is docked, but that shouldn't matter.

How can I show a little space on the left and right?
0
Comment
Question by:Kaprice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
zofcentr earned 2000 total points
ID: 37723808
There is property like padding for controls which sets this what you want.
Unfortunately for textbox like controls it is not used by Winforms framework.
Details here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.padding.aspx

There is probably more then one workarounds like below one.

Create panel with border and color like your Textbox.
Set padding of this panel and insert textbox into the panel
Set textbox border to none.

Hope this will help
0
 

Author Closing Comment

by:Kaprice
ID: 37723984
I'm shocked and disappointed that MS neglected the very obvious and valuable property of text margin for textboxes.

But, you've provided a very easy workaround. Thank you!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 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