Hi,

I want to create some buttons run-time, based on the program parameters. The problem I have is that the text on a button determines the width of a button. The more text there is on a button, the wider it becomes. In that case the dialog needs to be bigger too. Is there a way to pre-calculate the width of a button before actually showing it ? I tried creating the button on a window before showing it so I could get the width, but it seems that in that case the long text size isn't calculated and all buttons claim they have the same size, but as soon as I show the dialog, the long text on the button resizes the button and the pre-calculated width is wrong.

Any ideas ?