473,804 Members | 3,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Paddi ng.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
"ABCDEFGHIJ K" 115
"ABCDEFGHIJ KL" 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 2254
On Nov 29, 1:53 pm, ags5406 <my.spam.5...@g mail.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.Paddi ng.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
"ABCDEFGHIJ K" 115
"ABCDEFGHIJ KL" 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 TableLayoutPane l?

Chris
Nov 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
17882
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 return it slightly differently to the way in which it is stored. Basically, I want to return it as TRK000nnn - Where TRK is the string "TRK", 000 is zero-padding up to 4 zeros, and nnn is the number itself - results would look something like...
10
11460
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. With regular input such as textboxes, everything lines up fine. The problem I'm having is that I have an unordered list of checkboxes, and only the first item will line up with the label. The additional checkboxes and their labels end up being...
2
3997
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 label control and have it appear as if the 1st string is left justified & the 2nd string is right justified. How can I properly calculate the number of needed spaces when I'm using the label control's default MS Sans Serif font? OR does anyone have a...
2
1630
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 valid uses for setting an explicit width on a label...and no, I do not want to switch back into Quirks mode just to get it to work. TIA, mike
36
3054
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 get this kind of inconsistent result. -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
2
7963
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 for="v_no">Nein</label> </p>
8
31037
by: Alexey Smirnov | last post by:
How to make bold part of the text in a Windows.Forms.Label? Thank you.
2
2459
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 questions are:
8
2890
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 red;'>A bunch of text</h2> </body> </html>
0
10578
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.