Skip to main content
1-Visitor
July 23, 2019
Solved

Autoselect an invisible textbox

  • July 23, 2019
  • 2 replies
  • 1867 views

I have a textbox that takes input from a scanner (I'm using a hand-held Android based scanner). The user can scan bar codes and then services are run in the background once a user scans something. The textbox auto-selects, so there is no need for the user to click anywhere - he can just continue to scan different bar codes again and again, etc etc. 

 

This is exactly the functionality I want, except I just want to make the textbox invisible. Once I change the 'visible' property on the textbox widget to be 'false', the textbox will no longer auto-select and all my functionality goes out the window. 

 

Anyone ever run into this?

Best answer by khayes1

Would a simple workaround be to make the style properties of the textbox all set to none? (i.e background, foreground etc.) Not very elegant, but if all you are trying to do is hide the widget it would probably work.

 

alternatively you could place another widget on top of it via the z order?

2 replies

14-Alexandrite
July 23, 2019

Do you need to stay with using a textbox because of the hand scanner?

ague1-VisitorAuthor
1-Visitor
July 23, 2019

It doesn't necessarily need to be a textbox - but my scanning application is automatically parsed as keyboard input. So I supposed I could use any widget that reads keyboard input......

14-Alexandrite
July 23, 2019

Right, that makes sense. Would you be able to achieve the same functionality if you just made the box sized 1x1 and moved it to an inconspicuous location?

khayes11-VisitorAnswer
1-Visitor
July 23, 2019

Would a simple workaround be to make the style properties of the textbox all set to none? (i.e background, foreground etc.) Not very elegant, but if all you are trying to do is hide the widget it would probably work.

 

alternatively you could place another widget on top of it via the z order?

ague1-VisitorAuthor
1-Visitor
July 29, 2019

Taking all the styling out of the widget so it's completely invisible, worked. I also changed the text box option to 'mask input' and that hid the floating cursor as well. 

 

I tried moving the box behind another widget, but with the 'advanced responsive' type mashup, this wasn't possible.

 

Thank you!