KeyPress codes

pamoxi

Member
Licensed User
Longtime User
I am testing the Basic4PPC (Trial) and I am very happy with this RAD for now.

I need make arithmetics operations on change values in TextBox, but the event KeyPress fire before that the value in the TextBox are updated.

How I can make Calculations on change value in TextBox?

Very Thanks.
 
Last edited:

linum

Active Member
Licensed User
Hello. You might be able to use the Door Library to trigger your event after any text change. I use it on one of my apps to filter a table based on what is being typed on a textbox and it triggers right upon typing a new letter.

Here's the sample code from the Door library's manual:

B4X:
Events examples:
Handle the TextChanged event (fires whenever the text changes).
'obj is an Object, TextBox1ChangedEvent is an Event.
Sub App_Start
    Form1.Show
    obj.New1(false)
    obj.FromControl("textbox1")
    TextBox1ChangedEvent.New1( obj.Value,"TextChanged")
End Sub


Sub TextBox1ChangedEvent_NewEvent
    form1.Text = textbox1.Text
End Sub


Hope this helps you...



linum
 
Top