Re: Center text in a multiline button?
"Littlefield, Tyler" <[email protected]>
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <003f01c7beb4$68adcd80$6c01a8c0@tdsportable> |
why not write a function to do it for you? Take the size of the button, then take size of the text. Subtract the size of the button from the text, (the longest line, if it wraps), so you'll have to put it in an array. Then, just divide that by two, (use the modulous to get the remainder first) so you won't have extras, and you can space that many times over, just do something like append the spaces to the beginning and end of the string(s), you get my point, you'll just have to even them out. :) Hope this helps, or makes a bit of sense, or even works, just a quick idea, not tested. ----- Original Message ----- From: [email protected] To: [email protected] Sent: Thursday, July 05, 2007 7:21 AM Subject: [AutoIt] Center text in a multiline button? Hey gang, I have a gui with a number of buttons which have text that wraps to a second line. I tried various combinations of bs_center and bs_multiline but cannot get the text both to wrap and center. Since the buttons need to have a bit of dynamic sizing available it is too much of a pita to add spaces to each to get the text centered. Anyone? Thanks [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]