G Guest Oct 24, 2004 #1 Is there a simple way to vertically and horizontally center text within a control when using the DrawString method?
Is there a simple way to vertically and horizontally center text within a control when using the DrawString method?
B Bob Powell [MVP] Oct 24, 2004 #2 Use a StringFormat object and set the Alignment and LineAlignment properties to StringAlignment.Center. -- Bob Powell [MVP] Visual C#, System.Drawing 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 a StringFormat object and set the Alignment and LineAlignment properties to StringAlignment.Center. -- Bob Powell [MVP] Visual C#, System.Drawing 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