06-01-2017 03:28 AM
Hello
How can I write a pdf-file name list to indicator and choose to open one? Se attached pic. Top field is for automatic searching of pdf reports by letters. List under will update. This is OK, I know how to do this. But in pdf list it's possible to choose report and open it. How can this be done?
br,
paalbrok
Solved! Go to Solution.
06-01-2017 09:13 AM
http://digital.ni.com/public.nsf/allkb/9A6A259EB5A2BEDA86256DD00048C604
or
How Can I Open a Document in its Default Application Using LabVIEW?:
http://digital.ni.com/public.nsf/allkb/68A6F2A00872837E862576940059C142
06-02-2017 01:46 AM
I think you misunderstand. I want to open a pdf document from an indicator when they are listed there. If it's a pdf or whatever is irrelevant for my question. I should use my mouse button to choose the document in indicator, highlight it and then open it. In the program, it's done with the button under list (see pic).
What function can do this?
br,
paalbrok
06-02-2017 01:53 AM - edited 06-02-2017 01:59 AM
It sounds like what you're asking is how to choose the item?
If the list is an array of strings indicator, you'll have difficulty - I think you'd need to trap the mouse down (or up) event and then get the item from the mouse coordinates, which would be potentially frustrating to code.
If instead you're using a listbox (or multicolumn listbox, which it doesn't look like), then so long as it is a Control, and not an Indicator, you should have no problem. The 'Value Change' event will tell you when a new item is selected, and the value is the index of the list item. You can set the value of the strings using the Item Names property, which accepts an array of strings.
Once you have the index of the item, you can use Index Array with the Item Names property to get the value of the string clicked, and then use that to open your file (which it sounds like you don't need help with?).
A simple example is attached.
06-02-2017 03:40 AM
Great! This works perfectly. Thank you. Another question: How can I adjust the size of text automatically in all the cells of listbox. Some property node?
br,
paalbrok
06-02-2017 04:30 AM
If you want to change the font size, I think you should use a property node with two elements, 'Active Row' and 'CellFontSize', which are both under the Active Row section.
If you set Active Row = -2, then it will set all rows (-1 is the header, and 0+ are specific rows). The same is true for a Multicolumn Listbox (and you can use -2,-2 to get all cells there).
06-02-2017 05:00 AM
Thank you for your help.
br,
paalbrok