A Andy Jun 20, 2004 #1 How to find out text width for specific font and text string. I need to dynamically generate labels and set its size property. TIA
How to find out text width for specific font and text string. I need to dynamically generate labels and set its size property. TIA
B Bob Powell [MVP] Jun 20, 2004 #2 Use Graphics.MeasureString -- Bob Powell [MVP] Visual C#, System.Drawing Image transition effects, snap-to-grid and Layered Windows are all discussed in May's edition of Well Formed for C# or VB programmers http://www.bobpowell.net/currentissue.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
Use Graphics.MeasureString -- Bob Powell [MVP] Visual C#, System.Drawing Image transition effects, snap-to-grid and Layered Windows are all discussed in May's edition of Well Formed for C# or VB programmers http://www.bobpowell.net/currentissue.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
H Herfried K. Wagner [MVP] Jun 20, 2004 #3 * "Andy said: How to find out text width for specific font and text string. I need to dynamically generate labels and set its size property. Click to expand... Notice that labels provide an 'AutoSize' property.
* "Andy said: How to find out text width for specific font and text string. I need to dynamically generate labels and set its size property. Click to expand... Notice that labels provide an 'AutoSize' property.