EnableExplicit Define EventID Define SGDownUpButtonHandle If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) SpinGadget(1, 10, 10, 100, 20, 0, 100, #PB_Spin_ReadOnly | #PB_Spin_Numeric) SetGadgetState(1, 10) SGDownUpButtonHandle = GetWindow_(GadgetID(1), #GW_HWNDNEXT) SendMessage_(SGDownUpButtonHandle, #UDM_SETRANGE32, 20, 0) Repeat EventID = WaitWindowEvent() If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf