08-01-2010 11:09 AM - edited 08-01-2010 11:11 AM
How would I create a button like the print button below?
I was thinking actually make it two separate buttons placed next to each other. The print button obviously would just be a modified boolean, that's easy. But the drop down is a bit harder. I figure I could customize a drop down but because I haven't been able to play around with it in LabVIEW (don't have it at home) I'm not sure if you can modify the alignment of the box that actually drops down etc. Is the drop down box location and look something you can modify within the control editor?
I'm guessing I could also use .net correct? But I am trying to keep it all with just control modification in LabVIEW if possible. Thanks.
Solved! Go to Solution.
08-01-2010 08:57 PM
The obvious control for the drop down would be a listbox which should allow you to have custom icons for each line. Obviously, you can use some simple position and size properties to place the listbox exactly where you want it. You may wish to place it in a tab or have it as another VI. Another option might be turning the whole thing into an XControl, but then you should make sure you can dynamically resize the XControl, so it displays the whole list. Also, remember that XControls can't outgrow the bounds of their container.
08-02-2010 06:05 AM
In 'the good old days' when you didn't have a native 'right click menu', you could write a vi to get that functionality. Search the forums (LAVA as well) for some code using 'drop-down menu' or 'pop-up menu'. There should be at least two implementations in LV 7 or 6. It requires some code to resize the FP of the vi depending on the entries in the list/ the size of the control.
Then uncheck all the options like window has a title bar etc.
In addition you need some code that places the vi's FP at the right place.
Felix
08-02-2010 11:33 AM
Would a Run Time Menu not work? Right click on an item and a pop-up is displayed. It sort of looks like the one shown. Search for examples.
08-02-2010 02:06 PM - edited 08-02-2010 02:09 PM
for(imstuck),
I'd use a multicolumn listbox and toggle it's visibility when the user clicks on the button. I've attached an example:
~Simon
08-02-2010 03:31 PM
http://decibel.ni.com/content/groups/ui
simon to the rescue
08-02-2010 05:59 PM
all these are good, and possible solutions so I'm not going to mark any as solution, but I like Simon's idea!
08-02-2010 06:20 PM
Whatever works for you (or you like most), mark it as the solution.
It makes this thread 'solved' and anyone who has the same issue might quickly jump to a good concept.
Felix