Author: Bob MastaBob Masta
Date: Feb 12, 2008 13:51
Anyone know the secret to controlling the width of an
stand-alone (not a buddy) Up-Down control from a resource
definition? The height seems to be the only thing that changes.
I am using definitions like:
CONTROL "", IDC_MY_CTRL, "msctls_updown32", 0x0, 10, 10, 20, 20
I expected the last 2 values to control the width and
height, respectively, but the "width" value seems to
have no effect. (Tested over 10 to 40 range.)
Curiously, if I make this into a horizontal "Left-Right"
control, the sizes work as expected:
CONTROL "", IDC_MY_CTRL, "msctls_updown32", UDS_HORZ, 10, 10, 24, 12
I'd really like to keep everything in the resource. I know
I could use MoveWindow or SetWindowPos in the main
program (after messing around with dialog-to-pixel conversion).
Likewise, I presume I could do this with CreateUpDownControl and
monitoring UDN_DELTAPOS messages, but that's certainly a
lot messier than a simple resource definition... if only
it worked!
Any ideas? Thanks!
|