LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick way to remove multiple controls from a panel

I have over 1000 Command Buttons on a panel.  I am looking for a quick way to remove them.  Currently I am using the DiscardCtrl() command but it take over 10 seconds to remove all the controls.  

0 Kudos
Message 1 of 4
(1,569 Views)

There is no function that permits you to discard multiple controls at once: all functions that address multiple controls (and you can find several of them in the User Interface library or in the Programmer's Toolbox library) cannot discard them.

You may probably speed up your process by hiding the panel before proceeding to discard the controls, the panel may or may not effectively disappear from screen depending on some factors so a dialog wait message may be useful to inform the user.

 

But apart from improving process efficiency... are you sure of your UI design? A window with 1000+ command buttons is a pain to look at and to operate on! I would suggest you to spend some time to redesign it in order to make it more user friendly, just as an example moving from this:

image.png

 

 

 

to this:

image.png

 

 

Grouping controls with tab controls or independent panels is another alternative you may use.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(1,528 Views)

Thank you for your response.

FYI ... I work for a company that designs and builds contactors for IC devices that are tested in the semiconductor industry.  These controls are generated by reading in a DXF file for the location of the IC's lead/ball and then a map is created on the panel to represent the leads/balls mapped to the panel.  I use these to show pass/fail, move our stage to the location, show test results, etc.

0 Kudos
Message 3 of 4
(1,516 Views)

Of course you are the master in your application and I understand that your scenario is not a standard UI application which my comment was aimed to.

 

How did the hide-panel trick worked for you?

It has just come to my mind that you may have a possibly better performance by hiding the controls instead of discarding them, maybe you could experiment with this approach too.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(1,494 Views)