May 04, 2024, 12:32:10 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


UpDown Control

Started by Brian, November 28, 2010, 07:40:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

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

Egil

Never done such thing myself, but why not try the spinner control? (part of the contraol pack that comes with EB).

Good luck!

Egil
Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

November 28, 2010, 08:45:41 AM #3 Last Edit: November 28, 2010, 08:48:09 AM by Brian Pugh
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

LarryMc

Egil is right about using the control pak to accomplish what you are doing.
It just makes it a little more straightforward.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

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

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library