Aaargh! I've just spent about 2 hours trying to get this UpDown control to work
CONTROL win,@EDIT,"",566,310,50,26,0x50812000,16
CONTROLEX win,"msctls_updown32","",566,310,40,26,UDS_AUTOBUDDY|UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_ARROWKEYS,0,17
SENDMESSAGE win,UDM_SETRANGE32,30,90,16
SENDMESSAGE win,UDM_SETBUDDY,60,0,16
All I want is the range to be from 30 to 90, and then pre-set the edit box buddy to 60
What am I doing wrong?
Brian
Never done such thing myself, but why not try the spinner control? (part of the contraol pack that comes with EB).
Good luck!
Egil
you're trying to set the range of the edit control:
SENDMESSAGE win,UDM_SETRANGE32,30,90,16
You need to set the range of the spinner:
SENDMESSAGE win,UDM_SETRANGE32,30,90,17
LarryMc
Larry, that's got it. Now why didn't I see that?
Next is how to set the spinner to 60 to show in the edit control
Thanks again,
Brian
Edit: I've got it - I had the wrong ID number again. Right code is:
CONTROL win,@EDIT,"",566,310,50,26,0x50812000,16
CONTROLEX win,"msctls_updown32","",566,310,40,26,UDS_AUTOBUDDY|UDS_SETBUDDYINT|UDS_ALIGNRIGHT|UDS_ARROWKEYS,0,17
SENDMESSAGE win,UDM_SETRANGE32,30,90,17
SENDMESSAGE win,UDM_SETPOS32,0,60,17
Egil is right about using the control pak to accomplish what you are doing.
It just makes it a little more straightforward.
LarryMc
Larry,
You know, I just plumb forgot about the Control Pak, but we're cooking now!
I have another problem. I have a main window, and I need to open a second
window to print data generated by the first window. When I close the second
window, a lot of the first window's controls and text disappears!
What's going on there?
Brian
Sapero will probably have a more professional answer but without seeing any code I would say invalidate the main window immediately after closing the second window.
or showwindow with a 0 then with a 1
or it might mean the second window needs the clipchildren flag.
LarryMc