Solved

Visual Studio 2010 - Looking for a margin inside Textbox

Posted on 2012-03-14
2
3,244 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 500 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

707 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