SpinCtrl not working

Okay, I have a dialog with an edit-field and a spin-control. In OnInitDialog, I call:

((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1))->SetRange(0, 10);
((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1))->SetBuddy(GetDlgItem(IDC_EDIT1));

I can insert numbers into the edit, but when clicking on the spin, nothing happens... ideas?

I tried:
- Set the edit to numbers only
- Set auto-buddy style
... with no effects.

*edit*
The dialog and the controls are created with resource-editor.
[529 byte] By [martho] at [2007-11-18 3:48:59]
# 1 Re: SpinCtrl not working
Have you reordered the tab stops so the control and edit are in the right order?
Tom Frohman at 2007-11-11 3:39:32 >
# 2 Re: SpinCtrl not working
Set UDS_SETBUDDYINT style in resource editor.
JohnCz at 2007-11-11 3:40:32 >
# 3 Re: SpinCtrl not working
Thanx for your answer.

Taborder:
Edit is 56.
Spin is 57.
... should be right, or?
martho at 2007-11-11 3:41:41 >
# 4 Re: SpinCtrl not working
Originally posted by JohnCz
Set UDS_SETBUDDYINT style in resource editor.

... that does the trick. Thanx a lot!
martho at 2007-11-11 3:42:38 >
# 5 Re: SpinCtrl not working
Originally posted by Tom Frohman
Have you reordered the tab stops so the control and edit are in the right order? This is relevant if UDS_AUTOBUDDY style is set.

martho is using SetBuddy, therefore it is not a case.
JohnCz at 2007-11-11 3:43:37 >