LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog Box automatic field selection + Enter key & OK button mapping.

Using Labview 7, I create a dialog box that prompts user for input (one field).



Is there any way to configure the automatic selection of this field, such that user does not have to point mouse and click field for data entry? More over is there anyway to configure a mapping of the enter key being pressed to the OK button?



The background for the question is that I am using a barcode scanner that interfaces through the keyboard. A scan causes the barcode text to be entered followed by a as if the user entered "012345678". Thus when the dialog pops up, I would like the barcode field to be acitve/selected and when the is received this should stimulate the OK button.


0 Kudos
Message 1 of 5
(4,156 Views)
Bothe things are easy to do. First, right click on your text b0x and select Create>Property Node. Next, right click the property node and select Properties>Key
Focus. Make sure the property node is set to "write" and wire a True Bollean constant to it. For the OK button, right click and select Advanced>Key Navigation. You'll get a dialog box that gives you the option of assigning the Enter key to the button.
Message 2 of 5
(4,156 Views)
Use a porperty node and write a true to the key focus property of the text control.

If you need the OK button to react to an enter just right click on it, select advanced and key navigation and set the shortcut to enter.

Instead of using a dialog box to retrive the keyboard input though I would just read the keyboard input directly, e.g. using the key down event. Create a shift register to hold the previous keys and add new keys every time that event fires. If the character is a CR process the bar code and clear the shift register.
0 Kudos
Message 3 of 5
(4,156 Views)
yup, that did the job. many thanks.
0 Kudos
Message 4 of 5
(4,156 Views)
I have a problem seemed.

I have eight string box. In Each string box you put text with scan bar code.

I wish that in new dialog you can see the text of string box when you press ENTER.

Is it possible?
0 Kudos
Message 5 of 5
(4,156 Views)