Am 27.03.2017 21:29, schrieb Riccardo: > I have an observer on a ValueBox control to prevent it changing to zero and > to prevent it becoming larger than the value in a different ValueBox. > > Public Sub valNumObserver_change() > > If valNum.value = 0 Then valNum.Value = 1 > If valNum.Value > valDen.Value Then Stop Event > > End > > With first case, where the zero value is changed to one, works. But the Stop > Event doesn't do what I expect (it does nothing actually) in the second > line... >
When valNumObserver_change() starts, the Value has already been changed. So why not changing it back as you do in line 1? If valNum.Value > valDen.Value Then valNum.Value = valDen.Value Regards Rolf ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user