473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

LABEL padding isn't really zero

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
1 2235
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rowland | last post by:
Hi, I've got a field that stores numeric values, representing a tracking number. I've also got a stored procedure that will extract this field and return it to a client. However, I would like to...
10
by: Steve | last post by:
I'm not sure if I should be using tables here to structure the layout or if CSS is okay. I have a data entry form in which I have floated the labels to one side, and given them a specific width....
2
by: John Bowman | last post by:
Hello, I need to concatonate 2 strings and insert padding spaces in between them. The number of padding spaces needs to be calculated such that I can place the entire resultant string into a...
2
by: MichaelY | last post by:
Anyone figure out a workaround for setting the width on labels in 2.0??? I know width is no longer a valid property on inline text elements (per W3C), so what are the other options??? I have many...
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
2
by: André Hänsel | last post by:
Hi again, I have a radio button: <p> <input id="v_yes" type="radio" name="v" value="yes" /> <label for="v_yes">Ja</label> <input id="v_no" type="radio" name="v" value="no" /> <label...
8
by: Alexey Smirnov | last post by:
How to make bold part of the text in a Windows.Forms.Label? Thank you.
2
by: shapper | last post by:
Hello, I am styling the labels on a section of my page as follows: label {float: left; width: 6.5em;} Now I want to remove this styling from a label that has the class "Message". Mu...
8
by: rodeored | last post by:
page: http://reenie.org/test/blockpadding.htm code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>test</title> </head> <body> <h2 style='padding:0; border:solid 1px...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.