Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in a dialog based MFC application, i've two controls, an edit box and a spin ctrl. i set the edit box as a spin ctrl's buddy and set the spin ctrl's range from -10 to 10. do i need to do anything more to show the value of pos of the spin ctrl in the edit box? if so, why and what? the spin ctrl knows everything for handling the value inside the edit box, but it doesn't show anything inside it. why?
Posted

You need to set the Set Buddy Integer property of the spin control to True.
To set the initial value to a particular value other than 0, use the SetPos function of the spin control.
 
Share this answer
 
Comments
ilostmyid2 21-Jun-12 2:42am    
what's Set Buddy Integer property of the spin ctrl and how can i set it?
«_Superman_» 21-Jun-12 2:47am    
Select the spin control in the dialog template and press F4 to go to the properties window. There you can see the said property called Set Buddy Integer. By default its value is False. You can change that to be True.
ilostmyid2 21-Jun-12 2:45am    
oh thank u :)
it solved the problem
Did you also set the UDS_AUTOBUDDY[^] property on your spin control?
 
Share this answer
 
Comments
Niklas L 15-Jun-12 4:09am    
That's not necessary if you set the buddy control manually.
Richard MacCutchan 15-Jun-12 4:21am    
Yes, but OP is not doing that, hence his question.
ilostmyid2 21-Jun-12 2:40am    
yes, but it has no effect
Richard MacCutchan 21-Jun-12 3:04am    
What is that supposed to tell us? If you still have a problem then edit your question and fill in the full details.
ilostmyid2 21-Jun-12 3:53am    
_Superman_ gave the solution, thanx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900