stordaz Posted January 26, 2004 Posted January 26, 2004 Hi How can I know the height of a text in a textbox; I mean the job of the old Textheight property. Thanks Quote
NK2000 Posted January 26, 2004 Posted January 26, 2004 i dont know much about vb.net but in c# it would be int height = myTextBox.Font.Height; myTextBox is the name of the object which is a TextBox should be quite similar to vb.net i think Quote
NoLongerMicah Posted February 23, 2004 Posted February 23, 2004 What is the equivalent for determining Text Width (TextWidth in VB)?? Quote
*Experts* mutant Posted February 23, 2004 *Experts* Posted February 23, 2004 You can get the width of text using the MeasureString method of a graphics object which will then return the size based on the string and the font you used: Dim gr As Graphics = Me.CreateGraphics() Dim wth As Single = gr.MeasureString("Some text is there", Me.Font).Width Quote
sjn78 Posted February 23, 2004 Posted February 23, 2004 This is a little different, but wondering if MeasureString could be used in the following. I am making reports and need to show data in columns. Problem is with TT Fonts, the letter widths all vary, so it's hard to align them to so they look right justified. Is the MeasureString accurate enough to be able to work out the start position and end up having them aligned correctly. Quote
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.