jrp Posted July 31, 2025 Posted July 31, 2025 Hello, UniSpinEdit.MaxValue works only when you click the up & down buttons, but does not work when you type the numbers directly. And doing something like if UniSpinEdit1.Value > UniSpinEdit1.MaxValue then UniSpinEdit1.Value := UniSpinEdit1.MaxValue; do not work in these events: OnChange, OnChangeValue, OnExit, OnKeyPress. Does anyone have a solution? Thanks Quote
Sherzod Posted July 31, 2025 Posted July 31, 2025 Hello, 2 hours ago, jrp said: UniSpinEdit.MaxValue works only when you click the up & down buttons, but does not work when you type the numbers directly. Try this approach: UniSpinEdit.ClientEvents.ExtEvents -> function render(sender, eOpts) { sender.on('change', function() { var max = sender.maxValue || 100; var val = parseInt(sender.getValue(), 10); if (val > max) { sender.setValue(max); } }); } 1 Quote
SISBLU Software Posted September 24, 2025 Posted September 24, 2025 How can I set minimum value too? Quote
SISBLU Software Posted September 24, 2025 Posted September 24, 2025 it works: function render(sender, eOpts) { sender.on('change', function() { var max = sender.maxValue || 31; var min = sender.minValue || 1; var val = parseInt(sender.getValue(), 10); if (val > max) { sender.setValue(max);} if (val < min) { sender.setValue(min);} }); } Quote
SISBLU Software Posted September 24, 2025 Posted September 24, 2025 It worked correctly, but if allowed, it leaves the field blank. How can I prevent it? Quote
Sherzod Posted October 6, 2025 Posted October 6, 2025 On 9/24/2025 at 6:41 PM, SISBLU Software said: It worked correctly, but if allowed, it leaves the field blank. How can I prevent it? Hello, If you haven’t solved the issue yet, could you please explain it again in more detail or provide a simple test case? Quote
SISBLU Software Posted October 9, 2025 Posted October 9, 2025 It's working with the script. However, if I delete it using my keyboard, it leaves it blank. I didn't want it to be blank. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.