[Gambas-user] Valuebox change event?

Benoît Minisini gambas at ...1...
Sun Mar 10 18:43:48 CET 2013


Le 10/03/2013 18:34, Jesus a écrit :
> Hi all
>
> Since gambas2 I've not used Valuebox until now in Gambas3, but now I'm
> surprised it haven't a '_Change()' event. Anyone could tell about it, if
> you have got the need of this event or not? And how I supposedly could
> detect whether its content has changed?
>
> Of course, I always can inherit and implement a change event, but I was
> curious on why this widget lacks the change event natively.
>
> Thanks for your time
>
> Best regards
>

Mmm... You're right, a Change event would be useful... I will see if I 
can add it...

As a workaround, you can create an observer on the first inner child of 
the control to catch it.

hObs = New Observer(TheValueBox.Children[0]) As "TheValueBox"
...
Public Sub TheValueBox_Change()
...
End

But beware that you must do it just after having set the Type property 
(because it recreates the inner widget each time you change the ValueBox 
type).

Regards,

-- 
Benoît Minisini




More information about the User mailing list