How to adjust text padding when using drawstring?
Posted on 2008-10-05
The app that I am writing is to act as an editor for software screens that are a part of the software that belongs to my company. Where there screen is designed by strictly typing in variables into a text file, I am trying to create a drawing program that will allow me to simply draw the objects just as you might do with a paint program.
So to start, I load my screen based on the very same file that was first created by hand typing the values. So far everything is working perfectly. All the elements are of the exact same size, shape and color of the elements as they appear in my companies software. With just one exception...........
I am using drawstring to paint some text on the screen by taking the top, left, width, text and font values from the text file. I draw the text and draw a rectangle around the text (same rec as for drawstring) and while the rectangle appears to be the exact same shape and size between the two screens as do the size of the font, it appears as if drawstring has some sort of padding around the text.
The result is the text doesn't fit in the text box correctly.
Anyone have any ideas on how to adjust this in VB.net?
This padding is the only thing keeping me from sending this app to the beta testers!
Thanks in advance.