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
Solved

Visual Studio 2010 - Looking for a margin inside Textbox

Posted on 2012-03-14
2
2,944 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

840 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