[Gambas-user] webtextbox and object.attach

Marco Ancillotti gambas at servinfo.it
Wed Sep 20 15:55:47 CEST 2023


Hi all,

I have a gb.web.gui app , I made a webtextbox and use it's _Change() 
event to modify the content when I insert something.

It works but , if I want to move che _Change() on a different class and 
then connect using object.attach() it seem to not work.

Other event like _KeyPress() works but _Change() don't.

I made something like:

WEBFORM CLASS:
Public Sub WebForm_Open()
   Object.Attach(<WEBTEXTBOX1>, <MYCLASS>, "aaa")
Object.Attach(<WEBTEXTBOX2>, <MYCLASS>, "bbb")
End

MYCLASS CLASS:
Create Static

Public Sub aaa_Change()
   Object.Lock(Last)
   Last.Text = "hello"
   Object.Unlock(Last)
End

Public Sub bbb_KeyPress()
   Last.Text = "_"
End

The first don't work but the second do , is there some particularity on 
using _Change form other class ?

Thanks,
marco.






More information about the User mailing list