LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

suggesting text as a drop down list

May be somebody already ask this question.

 

I would like have a user interface,  with a suggesting name.

for example,

1. initially I have names such as: Andrew B, Andy C, Bill M, Bob T, Barbara K, Tony A. ...  and so on in a text file.

2. on the front panel, I have a text string control for the users type in their name.

3 when the user type in B (which can be Bill M, Bob T or Babara K)

4. then the program brings up the three suggesting names, saving the user from typing the rest of the string.

5. I believe that I saw this a lot on internet, but I am not sure how the details work.

 

regards

0 Kudos
Message 1 of 8
(7,021 Views)

The easiest is to use a combo box (from the string palette), which has a Strings[] property and does the filtering automatically.

 

You can also write use code to do more clever filtering, but I don't think you'll need that.


___________________
Try to take over the world!
Message 2 of 8
(7,009 Views)

Thanks tst,  for answering my question.

will the string control/input box, fill out the rest of the name?

 

ex: for my example, there is three names start with B;  (Bill M, Bob T and Barbara C....)

 

user types in: B         in the string control (or input) box.

 

the program : suggest by pop in three names   Bill M, Bob T and Barbara C

 

user types in: i                 which is now Bi

 

the program: eliminates the other two choices (Bob T and Barbara C) and fill out the rest in the string  or box as Bill M

 

Can you point me to an example VI to do this or    a keyword search  ?

 

 

0 Kudos
Message 3 of 8
(6,970 Views)

The combo box does not actually display the list, only does the autocomplete.

 

If you want, the attached quick example which I wrote a long time ago does the display as well. If you want some more clever handling, you can also have a look at the VIs I posted here, which handle keyboard clicks as well and do a smarter search.


___________________
Try to take over the world!
0 Kudos
Message 4 of 8
(6,957 Views)

Bringing this back. When I change the combo box to hex display, and try and type in AA for example, it automatically changes it to 0A0A, when I actually need it to be AA55.What gives?

0 Kudos
Message 5 of 8
(6,586 Views)

@Demetri90 wrote:

Bringing this back. When I change the combo box to hex display, and try and type in AA for example, it automatically changes it to 0A0A, when I actually need it to be AA55.What gives?


I don't normally use combo boxes, but I would say this looks like a bug with the combo box - when it's set to hex display it seems to sometimes treat the first character you type as if there was already a 0 typed before it. This doesn't happen all the time, but it does seem to happen more often than not. Also, it happens with the first char you type, even if there is already something in the combo box.

 

I posted a report here - http://forums.ni.com/t5/LabVIEW/Bug-report-Setting-a-combo-box-to-hex-adds-a-quot-0-quot-every/td-p/...


___________________
Try to take over the world!
0 Kudos
Message 6 of 8
(6,565 Views)

This problem is being looked into. See the linked report above for updates.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(6,542 Views)

Odd that I stumbled upon this bug (Newbie). I guess the combobox isn't used that often?

0 Kudos
Message 8 of 8
(6,530 Views)