サンプルコードとドキュメント

How to Edit Values Inside of Array Controls with Keyboard Shortcuts(キーボードショートカットで配列制御器内の値を変更する方法)

コードとドキュメント

添付

すべてをダウンロード

Summary (概要)

I can tab through the controls on my front panel during run-time, but I can only edit the values in scalar controls... How can I change my program so that I can edit the values inside of the array as well?

Unfortunately, this function isn't available in LabVIEW... But you can create your own workaround with the Event Structure! Take a look at this example program to see how you can implement this functionality.

プログラム実行中にフロントパネル上の制御器をTabキーで選択し、スカラー制御器の値は変更できるが、配列制御器内の値はマウスでクリックしないと変更できない…

LabVIEWの標準機能としては実装されていないものの、イベントストラクチャを使用すればその様な機能を実装できます!詳しくはこのサンプルをご参照ください。

Details (詳細)

How to use this sample:

1) Run the sample by pressing Ctrl+r.

2) Tap the Tab key to cycle through the controls on the front panel.

3) Press the Enter key when focused on the array control to set the focus on one of the elements in the array.

4) Press Tab or Shift-Tab to cycle through the elements in the array.

5) Press the Escape key to set the focus back on the array control.

Note: The Escape key won't allow you to move the focus back onto the array control (since you didn't select the array shell before moving the focus to the array element), so press the Enter key again to remove the focus from the front panel controls.

サンプルの使用方法:

1)Ctrl+rでこのプログラムを実行する。

2)Tabキーで各制御器にフォーカスをあてる。

3)配列シェルにフォーカスがあたっている状態でEnterキー(またの名をReturnキー)を押すと配列要素にフォーカスがあたる。

4)配列要素間でフォーカスをあてるためにTab、またはShift+Tabを押す。

5)配列要素が選択された状態でEscapeキーを押すと配列シェルにフォーカスがあたる。

注意:マウスで配列要素を選択した場合はEscapeキーでは配列シェルにフォーカスがあてられないので、再度Enterキーを押すことでフォーカスをシェルから外してください。

実装・実行方法

How to use this sample:

1) Run the sample by pressing Ctrl+r.

2) Tap the Tab key to cycle through the controls on the front panel.

3) Press the Enter key when focused on the array control to set the focus on one of the elements in the array.

4) Press Tab or Shift-Tab to cycle through the elements in the array.

5) Press the Escape key to set the focus back on the array control.

Note: The Escape key won't allow you to move the focus back onto the array control (since you didn't select the array shell before moving the focus to the array element), so press the Enter key again to remove the focus from the front panel controls.

サンプルの使用方法:

1)Ctrl+rでこのプログラムを実行する。

2)Tabキーで各制御器にフォーカスをあてる。

3)配列シェルにフォーカスがあたっている状態でEnterキー(またの名をReturnキー)を押すと配列要素にフォーカスがあたる。

4)配列要素間でフォーカスをあてるためにTab、またはShift+Tabを押す。

5)配列要素が選択された状態でEscapeキーを押すと配列シェルにフォーカスがあたる。

注意:マウスで配列要素を選択した場合はEscapeキーでは配列シェルにフォーカスがあてられないので、再度Enterキーを押すことでフォーカスをシェルから外してください。

Requirements (必要なもの)

Software

- LabVIEW 2013 or later.

ソフトウェア

・LabVIEW 2013 以降

ハードウェア

なし。

NIコミュニティのサンプルコード交換のサンプルコードは、MIT Licenseによりライセンス供与されています。

寄稿者