Character "space" in a textbox -- same space used for upper and lower case?
-
Hey All, I've been playing with the textbox in C#. I cannot seem to get it so that uppercase characters and lowercase characters take up the same amount of space in the box. For example like in the textbox here on CP to enter messages: this line aligns perfectly with THIS LINE ALIGNS PERFECTLY They both align perfectly regardless of case. In my textbox, if I use uppercase on one line and lowercase on the next line, the uppercase line takes up a lot more space and they do not line up. TIA!
-
Hey All, I've been playing with the textbox in C#. I cannot seem to get it so that uppercase characters and lowercase characters take up the same amount of space in the box. For example like in the textbox here on CP to enter messages: this line aligns perfectly with THIS LINE ALIGNS PERFECTLY They both align perfectly regardless of case. In my textbox, if I use uppercase on one line and lowercase on the next line, the uppercase line takes up a lot more space and they do not line up. TIA!
-
...the two lines lign up perfect in the textbox here to enter in the message, but when it is displayed it is displaying exactly like I am talking about in my application.
-
Have you tried using a font like Lucida Console? (Fixed width font - every character uses the same width)
-
Incredibly cool, that worked!!!! Thanks! Do you know how to tell (other than trying them one by one) which fonts are fixed width? Again, thanks a lot!
You can retrieve a fixed width font family using System.Drawing.FontFamily family = System.Drawing.FontFamily.GenericMonospace.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world." Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that." Deja View - the feeling that you've seen this post before.
-
Incredibly cool, that worked!!!! Thanks! Do you know how to tell (other than trying them one by one) which fonts are fixed width? Again, thanks a lot!
http://en.wikipedia.org/wiki/List_of_typefaces#Monospaced[^] http://en.wikipedia.org/wiki/Samples_of_Monospaced_typefaces[^]
--EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters