PDA

View Full Version : resize RadioButtons to fit label?


stormwild
12-12-2004, 03:44 PM
Is there a way to resize a radiobutton to fit its label?

I generate the radiobuttons dynamically using createClassObject() and then assign the value for the label. However since the text is too long it gets cropped. I can resize the radiobutton using setSize(), however, I need to determine the value of the width of the label.

As a work around I dynamically generate a textfield first, set it to autoSize then assign the same text value as the radiobutton, store the textfield's width and use that width value to setSize the radiobutton. I then remove the textfields.

Just wondering if there's another way of doing it? Using the radiobutton's properties or methods?