LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Enter key from numeric keypad to enter and switch to next element in an array control

Thanks a lot.

But i'm looking how to change to under box not to the right box with the ENTER or RETURN key.

I want to fill the array but with the ENTER key fill next values to down.

Do you know something about this?

 

Regards

0 Kudos
Message 11 of 12
(542 Views)

The main problem with what you want is that the array does not provide a way of setting the edit position. Assuming you have a 2D array like in the example, here are two options.

 

The easy way is to use a table. It has an EditPos property and you can use the Key Down? event to set that property to what you want. The main issue with a table is that it is a 2D array of strings, and you might not want strings.

 

I haven't tried the harder way, but it goes something like this:

 

  1. Create an additional control (exactly the same as the control inside the array).
  2. On a Mouse Down? on the array use the coords data to determine which element was clicked and place the new control over it, while giving the control the element's value and setting the key focus to the control. Log in a shift register which element is the one being edited.
  3. On a Key Down? on the control, if the key was Enter, write the value from the control to the current element of the array and use whichever logic you want to move the control to the next cell you want to edit.
  4. You can do the same thing on a value change for the control, but then you can hide it. This will take care of a case where you click elsewhere after changing the value of the control.

___________________
Try to take over the world!
0 Kudos
Message 12 of 12
(527 Views)