LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Placing a spaces when typing TAB in string control

I want to workaround that in LabVIEW i can't make text alignment in string control with tab key. I created a simple VI for that, with event struct. So I intercepts events from keyboard and checks if it's tab key. If it's true, puts spaces into the string. The problem is this simple idea doesnt work...

How can i make it work?

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 1 of 4
(3,167 Views)

Several things complicate your attempt. When you discard the event for the tab key, the string is not updated.  You can use the regular Key Down event rather than the filter event.

 

You need to go to the Properties dialog for all the controls on the front panel and check the Tab Behavior: Skip This Control When Tabbing box.

 

I am not quite sure why but a local variable for the string control works better than the Value property node.

 

You also need to return the Key Focus to the string control after hitting the tab key. Even with all controls set to skip when tabbing, the tab key behaves some what like the Enter key and removes the key focus.

 

And you need to set the Text Selection to the end of the string so that the cursor stays at the end.

 

Lynn

Message 2 of 4
(3,136 Views)

Try using a monospaced font.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 4
(3,111 Views)

You could also use a Rich Text box.  This is essentially a .NET function in LabVIEW so it over takes the tab function and it appears to work as you would expect.  You may have other unexpected issues using this but it could work.

Message 4 of 4
(3,095 Views)