UI Interest Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying the ComboBox Control

I am trying to modify the ComboBox control to use on a touchscreen.  In the regular ComboBox control the selector button and the scrollbar in the drop-down are too small.  I can modify the selector button just fine but the scrollbar is not resizable.  I noticed the drop-down is really just a listbox but when I replace it with a listbox I have with large scrollbars the control no longer works.  I can see the the drop-down listbox in the Silver controls has been modified.  How do I make modifications to the scrollbar in the drop-down listbox of a ComboBox?

One solution I thought of was to change the size of the scrollbars for the system (changing the scrollbar size in Windows).  But I can't because I share the system with other applications.  I need a solution by creating my own custom controls.

Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



0 Kudos
Message 1 of 7
(9,811 Views)

I had a project dealing with same issue (among others related to LV appearance), and the answer was "you can't". We ended up making an X-Control. It was a lot of work.

0 Kudos
Message 2 of 7
(5,394 Views)

David is correct, but to clarify: the drop-down on the combobox is not actually a listbox. It is a menu. Therefore, it uses the system definition of how a menu should appear, including the scrollbar size.


Christina Rogers
Principal Product Owner, LabVIEW R&D
0 Kudos
Message 3 of 7
(5,394 Views)

David, when you made your X-Control, was it before LabVIEW 2011? The Silver style listbox allows you to change the scrollbar width (which wasn't possible with the older listbox styles) so it may be easier to make such an X-Control now.


Christina Rogers
Principal Product Owner, LabVIEW R&D
0 Kudos
Message 4 of 7
(5,394 Views)

It was in LV 2013. There were other UX/style requirements that the Silver control couldn't meet, so we had to do it the hard way. We ultimately got the look and behavior we needed, but it took a senior LV developer about 40 hours to make and debug the X-Control.

0 Kudos
Message 5 of 7
(5,394 Views)

The system listbox also allows you to resize the scrollbar but one caveat to that is that the "autoResizeScrollbars=false" token has to be added to the LabVIEW.ini or the scollbars automatically resize  back to the system set size every time LabVIEW starts.  (See Forum Post Here).  However, it seems after compiling into an executable the token is not needed.  This is still true as of LabVIEW 2012; untested on LabVIEW 2013.

I have also gone the XControl route.  I use a popup subVI as the drop-down menu with a listbox having the large scrollbar.  However, this leads to another problem I see and that is trying to dismiss this subVI when the user clicks off of the subVI in the XControl's owning VI or even off of the owning VI.  I have tried solving this by lauching an asynchronous, polling VI to watch for mouse clicks outside of the popup subVI.  It works; but is unreliable.

Do you have any other hints or tricks?

Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



0 Kudos
Message 6 of 7
(5,394 Views)

You can open a 99% transparent VI behind your pop up that fills the entire screen. This idea is similar to LAVA's dialog with blackening effect. That way the VI behind can have an event case watching for mouse down events. There doesn't seem to be a way outside of polling to check if a mouse down event happens outside of the labview window.

0 Kudos
Message 7 of 7
(5,394 Views)