joshuaand Posted October 29, 2003 Posted October 29, 2003 Hi, What I am doing is setting the text of a couple of radiobuttons automatically, and I would like to put them up next to each other once the text is set, but there is no autowidth property for the radio button, so I was using "MeasureString" to get text width, but it doesnt work properly, seems to work "OK" for small strings, then you get a large string and its way out. Any ideas???? thankyou Quote
*Gurus* divil Posted October 29, 2003 *Gurus* Posted October 29, 2003 It probably depends on the StringFormat you're using to draw the text. Use the CreateGraphics method of the radio button in question to get the graphics to measure from, then try passing StringFormat.GenericTypographic to the MeasureString method. 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
joshuaand Posted October 29, 2003 Author Posted October 29, 2003 STill Bad Hi, I tried using "StringFormat.GenericTypographic" which made it better but sting very wrong. Until I get a chance to look at it again I am filling a label with the text, autosizing it and getting the width, and adding 20 for the button. Dodgy but it works great! 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.