By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

LABEL padding isn't really zero

P: n/a
i have a normal label with a fixed width font with no padding...

lblsizing.Font {Name = "Lucida Console" Size=12.0} System.Drawing.Font

lblsizing.Padding.All 0 Integer

but despite the fact that the padding property is set to zero, there
is still some bit of (natural) padding that is not adjustable... i
can determine this by observing the width of the label while adding
additional characters to the text of the label...

lblsizing.text lblsizing.width
"" 0
"A" 16
"AB" 26
"ABC" 36
"ABCD" 46
"ABCDE" 55
"ABCDEF" 65
"ABCDEFG" 75
"ABCDEFGH" 85
"ABCDEFGHI" 95
"ABCDEFGHIJ" 105
"ABCDEFGHIJK" 115
"ABCDEFGHIJKL" 125

looking at the widths, i can determine that adding an additional
character adds 9.xxx (almost 10) to the width, so the padding must be
roughly 6, or 3 on each side

i have no idea of the exact incremental width associated with adding
an additional character due to the .Width returning an integer...

anyway, i have multiple labels on multiple lines that may be offset
from each other and am having a very difficult time determining
what .LEFT value to give each label so that the characters line up in
perfect columns from the top of the form to the bottom...

any suggestions?

Nov 29 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Nov 29, 1:53 pm, ags5406 <my.spam.5...@gmail.comwrote:
i have a normal label with a fixed width font with no padding...

lblsizing.Font {Name = "Lucida Console" Size=12.0} System.Drawing.Font

lblsizing.Padding.All 0 Integer

but despite the fact that the padding property is set to zero, there
is still some bit of (natural) padding that is not adjustable... i
can determine this by observing the width of the label while adding
additional characters to the text of the label...

lblsizing.text lblsizing.width
"" 0
"A" 16
"AB" 26
"ABC" 36
"ABCD" 46
"ABCDE" 55
"ABCDEF" 65
"ABCDEFG" 75
"ABCDEFGH" 85
"ABCDEFGHI" 95
"ABCDEFGHIJ" 105
"ABCDEFGHIJK" 115
"ABCDEFGHIJKL" 125

looking at the widths, i can determine that adding an additional
character adds 9.xxx (almost 10) to the width, so the padding must be
roughly 6, or 3 on each side

i have no idea of the exact incremental width associated with adding
an additional character due to the .Width returning an integer...

anyway, i have multiple labels on multiple lines that may be offset
from each other and am having a very difficult time determining
what .LEFT value to give each label so that the characters line up in
perfect columns from the top of the form to the bottom...

any suggestions?
Have you considered using a TableLayoutPanel?

Chris
Nov 30 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.