[Gambas-user] Valuebox change event?

Jesus ea7dfh at ...2382...
Sun Mar 10 19:25:28 CET 2013


El 10/03/13 18:43, Benoît Minisini escribió:
> 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,
>

Hi

Great! Thanks for the workaround, it helps a lot. Looking forward to the 
native change event ;-)

Regards

-- 
Jesus Guardon




More information about the User mailing list