Help getting textbox to release focus

I am working on an app that does some math calculations.

I have 5 textbox inputs (numbers only) and a "calculation" button. In my code, I have an "input_check" procedure I call just before the actual math. In my input_check, I evaluate each textbox, and if the textbox is empty, I insert 0.00 in place of the input.

When the app is running, I click on the 1st textbox and enter in my value. I keep doing this to each textbox that needs info. When I have done the last one, I hit "done" on the keyboard, and the keyboard disappears. But, the last textbox I was in stays focused.

Now, when I hit the button "calculate", since I never transferred focus from the last textbox to something else, my "input_check" thinks the textbox is empty, and inserts 0.00, even if I have a value entered in. It does not matter the order. If I enter in data into textbox 1, then 5, then 3, then hit calculate, TB3 gets set to 0.00. If I enter data in TB 1, then 2, then 4, then 5, then calculate, TB5 gets set to 0.00. It affects the last textbox selected.

Long and short, I am having trouble making sure the value I enter in on the last textbox gets accepted and stored.

This is my "input_check" block. I have one of these for every textbox. I also have a block "when In_Min_ROI.GotFocus" set "In_Min_ROI.Text" to " " (blank). This is set so when I click on a textbox, it clears the value and I enter in the new value I need.

Hello Vader

We can't really see what is wrong with only that snippet. However, you could release the focus from any of the 5 Boxes by setting the focus to another (which can be hidden in plain sight - make 2 pix x 2 pix, same colour as the background). When the Calculate button is tapped, it can change the focus before the calculation is performed. Worth a try?

That did it. I had a hidden block I used for testing, and my plan was to just delete the block, but instead I turned it hidden and when I hit the calculate button, I send the focus to that hidden textbox. When that happens, everything works just fine.

Thank you for your help. Great suggestion.