Re: Text entry limitation
Jean-Luc Arnaud <jean-luc-E/[email protected]>
| Newsgroups | gmane.comp.lang.realbasic.user |
|---|---|
| Organization | Centre Direct du Multimédia |
| Message-ID | <[email protected]> |
Clear, thank you. Jean-Luc Arnaud Le 18/08/2017 à 19:17, Roland Brouwers a écrit : > > I create a class with super = textfield = > myTextfield() > > If there are x textfields on the window, I will drag x times this > myTextfield in the window. myTextfield(0),myTextfield(1).... > (They are all members of an array of myTextfields(), you can define > this in the editor) > > Every myTextfield() has a handler keydown(Desktop) or keypressed(Web) > > So > *AddHandler tf101(fn).keypressed, AddressOf myMethod* > This will be defined in the open event of the window > fn = total number of myTextfield() > A for next loop will go through all myTextfields and for every myTextfield() the method 'myMethod' will be executed. > Therefor in myMethod we will*test every char.* > if asc(key)=13 or asc(key)=3 or asc(key)=9 then > goto next field > else > do something > end if > > I hope you can understand this explanation. > > Roland Brouwers > > C.A.T. bvba > Zevenbergenlaan 16 > B-2660 Antwerpen-Hoboken > Belgium > Mob: +32 475 443 105 > Op 18/08/2017 om 18:13 schreef Jean-Luc Arnaud: >> Thanks for the reply, Roland. >> >> It's not exactly my need. Nevertheless, I'm interested in your use of >> AddHandler, but don't understand it. >> >> Where do you place this code? >> >> What does tf101(fn) represent? >> >> Thanks for further information. >> >> Jean-Luc Arnaud >> >> Le 18/08/2017 à 11:14, roland a écrit : >>> I use the property limitText of a textfield. >>> >>> For the special character I use (this will be the filter) >>> AddHandler tf101(fn).keypressed, AddressOf myMethod >>> >>> Roland >>> >>> >>> Op 18/08/2017 om 10:35 schreef Jean-Luc Arnaud: >>>> Hi all, >>>> >>>> What's the best way to limit text entry to only some characters? >>>> >>>> Mask property doesn't seem to be the solution. >>>> >>>> Of course, I could code for a kind of filter, but in addition to >>>> authorized characters, I would have to manage Enter, Return, Tab, >>>> arrows, Delete, ... >>>> >>>> Any suggestion welcome. >>>> >>> >>> >>> >>> To unsubscribe, email [email protected] >>> >>> >> >> >> >> >> To unsubscribe, email [email protected] > > > To unsubscribe, email us here. <mailto:[email protected]> > To unsubscribe, email [email protected]