You could measure the size of the string with the Win32
GetTextExtentPoint32 function, then resize the control accordingly.
One thing that's kinda weird about this approach, though, is that you're going to have a switch or led (or whatever style you chose for the button) changing size based on the width of a string. Do you really want the whole control's size to change, or are you really just wanting the size of the control to change so that it can fit the string? If the latter, I think a better way to do this would be to use a CStatic. That way you can resize the static control to compensate for the size of the string without having to change the size of
the control, hence affecting the layout of your UI.
- Elton