[Gambas-user] Help with Observer 'Stop Event'
Rolf-Werner Eilert
rwe-sse at ...3629...
Wed Mar 29 10:51:14 CEST 2017
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
More information about the User
mailing list