[Gambas-user] Problema with stop event on gb.web.gui

Benoît Minisini benoit.minisini at gambas-basic.org
Fri Sep 15 15:48:29 CEST 2023

Le 14/09/2023 à 16:39, Marco Ancillotti a écrit :
> Hi all,
> I have a problem using stop event on keypress inside a webtextbox on 
> gb.web.gui.
> If I made a simple:
> Public Sub WebTextBox1_KeyPress()
>    If InStr("0123456789", Key.Text) = 0 Then
>      Stop Event
>    Endif
> End
> The webtextbox continue to receive all value , also number.
> Is this a bug or working with gb.web.gui pretend a different approach to
> made a textbox accept only some values ?
> Thanks in advance,
> Marco.

You can't cancel keypress events in 'gb.web.gui', as they occur inside 
the browser.

The browser is not allowed (not by me!) to send the event to the server 
and waits for its answer to know if it should cancel the event or not.

'Stop Event' just prevents the trigerring of shortcuts associated with 
the pressed key.


Benoît Minisini.

More information about the User mailing list