[Gambas-user] Controls WebForm Ignore Events

Benoît Minisini g4mba5 at gmail.com
Fri Jan 26 14:01:35 CET 2018


Le 26/01/2018 à 13:55, Mayost Sharon a écrit :
> Hello
> 
> gambas: 3.10.0
> 
> 
> Hello
> 
> Is there a possibility to cancel EVENT of a control
> I need this for the controls of WebForm
> 
> In my example I do it
> But it's complicated
> I want  not to run the WebTextBox1 event when I press WebButton1
> 
> If there was such a possibility
> WebTextBox.IgnoreEvent = True
> This will cause a WebTextBox
> events disable
> 
> or should give an event filter
> WebTextBox.IgnoreEvent = "Change;Clear"
> Only Disable Events   "Change" and "Clear"
> 
> 
> Thanks
> 
> ' Gambas class file
> 
> Export
> Private ignore_event As Boolean
> 
> Public Sub WebTextBox1_Change()
>    If ignore_event = False Then
>      WebLabel1.Text = WebTextBox1.Text
>    Endif
> End
> 
> Public Sub WebButton1_Click()
>    ignore_event = True
>    WebTextBox1.Text = "sharon"
>    ignore_event = False
> End
> 

You can prevent a Gambas object from raising events by using 
Object.Lock() / Object.Unlock().

Beware : that way you can't ignore events raised from the browser (in 
that example, when the user changes the text of the WebTextBox1 
control). Only those that are raised immediately from your code on the 
server side.

Regards,

-- 
Benoît Minisini


More information about the User mailing list