Reputation: 23
In my program, there would be a chance edit box, which changes the "drop rate" or "win rate"
But I would like to change it in such a way that if the user inputs a number higher than 100 and clicks out of the edit box, it the edit box text would change back into 100.
I have no idea how to implement this.
Upvotes: 2
Views: 413
Reputation: 366
Have a look at the following tutorial
You will have to use WM_COMMAND in your callback function to catch the messages/notifications that your edit box sends (for instance EN_CHANGE).
Then you can check the value inside the callback and revert to 100 if it's too high.
For further reference all edit control notifications are listed on MSDN.
Upvotes: 1