1. UpDown question...
- Posted by LEVIATHAN <leviathan at USWEST.NET> Dec 12, 2000
- 476 views
Heya all! I'm trying to get this UpDown to increment a number in a SLE. I have the updown all set up, and it seems to be together with the SLE, but it doesn't increment the number like I think it should. Can someone show me a piece of code that'll have a SLE with a number thats incremented by a updown? TIA, --"LEVIATHAN"
2. Re: UpDown question...
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Dec 12, 2000
- 490 views
> -----Original Message----- > From: LEVIATHAN > I'm trying to get this UpDown to increment a number in a SLE. I > have the updown all set up, and it seems to be together with the > SLE, but it doesn't increment the number like I think it should. Can > someone show me a piece of code that'll have a SLE with a number > thats incremented by a updown? >From the example included with win32lib: -- begin code include win32lib.ew constant Win = create( Window, "UpDown Demo", 0, CW_USEDEFAULT, CW_USEDEFAULT, 300, 200, 0 ), Num = create( EditText, "", Win, 20, 20, 90, 30, 0), UD = create( UpDown, "", Win, 20, 20, 0, 0, or_all( { UDS_AUTOBUDDY, UDS_ALIGNRIGHT, UDS_SETBUDDYINT, UDS_ARROWKEYS })), Num2 = create( EditText, "", Win, 20, 60, 90, 30, 0), UD2 = create( UpDown, "", Win, 20,20, 0, 0, or_all( { UDS_ALIGNRIGHT, UDS_SETBUDDYINT, UDS_ARROWKEYS })) setScrollRange( UD, 0, 10 ) setBuddy( UD2, Num2 ) setScrollRange( UD2, -10, 10 ) WinMain( Win, Normal ) -- end code Since you didn't post your code, I'm not sure where the problem is, but you need to make sure that the updown control is buddied to the edit control, and that the scroll range is set on the updown. You can use the UDS_AUTOBUDDY flag to automatically set the buddy control as the last control created, or you can set the buddy using setBuddy()--both are shown in this code. Matt Lewis