Drstein99 Posted October 7, 2003 Posted October 7, 2003 How do i get the size in pixes of a specified string and font? Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Experts* Volte Posted October 7, 2003 *Experts* Posted October 7, 2003 YourGraphicsObject.MeasureString() Quote
Drstein99 Posted October 7, 2003 Author Posted October 7, 2003 The part I dont understand is the YourGraphicsObject. I simply want to pass a string and font. Where does the graphicsobject come from? Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Experts* Volte Posted October 7, 2003 *Experts* Posted October 7, 2003 You need to use a graphics object. For example, if it's in the Paint event, you can use e.Graphics.MeasureString(). If outside of the Paint event, you can use Me.CreateGraphics().MeasureString() (assuming you're in a form). Quote
Drstein99 Posted October 7, 2003 Author Posted October 7, 2003 got it. had to: tb1.CreateGraphics.measurestring thanks. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Gurus* divil Posted October 8, 2003 *Gurus* Posted October 8, 2003 If you're creating a graphics object like that, you should be disposing it too. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
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.