gtzpower Posted January 22, 2004 Posted January 22, 2004 Strange problem here. If i create a button (in C# or VB) the text won't TRUELY center unless the "flatStyle" property is set to "System" for that button. Does anyone know why this is? It only seems to do this when the text is so long (for example "Change Account Number"). Try it in your IDE, i am sure it will happen. This doesn't seem promising for a newbie to .net. Quote
Sheppard Posted January 22, 2004 Posted January 22, 2004 Centre It only moves the text slightly when you change from 'flat' etc. to 'System.' Isn't this because 'system' appears in 3D and therefore some of the object is used for shading, not the actual front of the button. Quote "Today I saw a little worm wriggling on his belly. Perhaps he'd like to come inside and see what's on the telly." - Spike Milligan (Tribute).
gtzpower Posted January 22, 2004 Author Posted January 22, 2004 I don't think so. "Standard" is also 3D, but that is off centered too. Here's a quick example i whipped up:crap.bmp Quote
hog Posted January 23, 2004 Posted January 23, 2004 Here is a complete...OMG stab in the dark.. Is it something to do with the actual font being used? Try using courier new and see the result. Quote My website
gtzpower Posted January 23, 2004 Author Posted January 23, 2004 Hey, thanks. I tried aerial last night, and it did the same thing, so i didn't think it was the font, but Courier works nicely. Is there a fix? I like the ms font, but alas, i am not totally held down to using "System" style buttons. Quote
gtzpower Posted January 23, 2004 Author Posted January 23, 2004 looking through the fonts, a lot of them are even off centered vertically Quote
hog Posted January 23, 2004 Posted January 23, 2004 I think it has something to do with proportional fonts or something? This I think is where in a given font it spaces the letters evenly, W I for example. Not sure if thats a good explanation but I think it is close:) Quote My website
ombun2 Posted February 14, 2005 Posted February 14, 2005 true type fonts (as most are today) are unevenly spaced so that they will look nicer according to whatever rules they were created. On the other hand monotype fonts such as courier new have a fixed length for each character (as was on a typewriter block) Quote
Leaders snarfblam Posted February 14, 2005 Leaders Posted February 14, 2005 Um... the fact is that when you use the Standard flatstyle, the .Net framework is rending your button and when you use the System flatstyle, windows is rendering your button. The difference is between who is rendering it, not the fonts. If you say that it is off center only when it is too long, it may be a minor bug in the .net framework, and yes, this may only occur with certain fonts or by something like roundoff error when cleartype is on or something. My guess is that it is always slightly off center (again, perhaps only with certain fonts) and the off-centerness is only noticable when the string is long enough that it reaches close to the left and right edges of the button. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.