From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you tell me how to load a Windows combo control into a CVI project?

I am currently developing a project in LabWindows/CVI and I need to use a drop down window with a maximum number of lines for viewing information. After the maximum number of lines is reached, a scroll bar needs to be added to the control to view all the lines of data. A control like this is not available in CVI. It was suggested that I use a Windows combo box by adding an ActiveX control and calling it. Can anyone tell me how to do this and/or give an example? Thanks.
0 Kudos
Message 1 of 5
(2,784 Views)
CVI does have a combo box custom control. You can use it as you want. It has a little different behavior than what you are saying. If you add too many items too the list, it doesn't add a scrollbar to the list. Instead, it makes the list a popup dialogs that lets you select an option. See the example program under /cvi/samples/userint/custctrl/combobox/combodemo.prj for a demonstration of how to use the combobox. If this tool (cvi/toolslib/custctrl/combobox.fp) meets your needs, it will be FAR easier to use than the ActiveX control method.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 5
(2,784 Views)
Thank you. Unfortunately I have a hard requirement stating that I can only have five lines (messages) in the drop down box and when there are more than 5 lines a scroll bar must appear to peruse the list. It needs to look similar to the combo box used to enter/select an address in a Micosoft Internet Explorer window.
0 Kudos
Message 3 of 5
(2,784 Views)
Unfortunate. In that case, you will have to use the Microsoft ComboBox control. In CVI 6.0, just go to your panel in the UIR editor and right-click and select ActiveX. From the list, pick Microsoft Forms ComboBox Control. That will add a combobox to your UIR. Then you can generate a wrapper driver for that control by right-clicking it and selecting, Generate ActiveX Control Driver. From there, use Microsoft's help for the control, built into the function panels for help in using the control. For more help on programming with ActiveX controls in CVI, consult the CVI help.

Chris
0 Kudos
Message 4 of 5
(2,784 Views)
Thanks Chris. That should get me started. I appreciate your taking the time to help me.
Thanks again,
Pat
0 Kudos
Message 5 of 5
(2,784 Views)