LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamicly created dialog controls

I am looking for a way to make a resizable dialog panel that is configured at runtime based on the number of units that may be tested at once. I have attached code that is a solution that I do not like as I have to create the most possible sub panel’s controls a head of time. This example has 12 but we may need up to 80. I am looking for a way to create as many sub panels as needed dynamically.

To look at the sample code unzip to a folder and run "Harris Dialog Test VI Sample.vi" the number of panels must be less than 12 and be sure to use the stop button to end as that vi closes all the other vi running. Any help would be appreciated.

Terrill
Message 1 of 7
(3,836 Views)
Terril,

Basically you are asking for a way to dynamically instanciate control on a panel. There is no "official" way to do this yet, but do not despair.

As I mentioned in this post Where can i find the classID list for Labview 7.0 there is a locked VI in LV7.x that allows dynamic instanciation of controls. The name of the VI is "Get Contorl From Type Descriptor.vi" and it is located in LVRoot\project\_NewProbeWizard.llb\Get Contorl From Type Descriptor.vi.

Note: You can instanciate control only on idle VI

Using this VI, you should have no proble to do what you want.

PJM


  


vipm.io | jki.net

Message 2 of 7
(3,812 Views)
PJM_Labview,

Thanks. That is great. I have needed this functionality many times. I am new to the forums and followed some of the suggested links. Looks like I have a lot of reading to do. Thanks again.

Terrill
Message 3 of 7
(3,802 Views)
I have looked at this and create many types of controls but when I try to create a sub panel it gives me a reference control. Is there any way to get a new subpanel? I have already tried forcing the reference to be a subpanel type.
0 Kudos
Message 4 of 7
(3,712 Views)
Another approach involves using the picture control to make it look like you have created new controls.

See this Link were Jean-Pierre first suggested an approach that was workable.

http://forums.ni.com/ni/board/message?board.id=170&message.id=24154&query.id=0#M24154

That link shows you how to handle the images. As far as interacting with these "virtual controls" I have used a number of methods. The easiest involves detecting the mouse down event on the picture and then moving an "off-screen" control such that it over-laps the image in the picture control and hiding it when done.

I have used this approach quite a few times with good results.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 7
(3,692 Views)
Ah Ah !

It look like you found the only FP Object that can not be created by this method.

But again, there is another way 🙂

This one used a scripting primitive that was exposed in LV 7.0.

See the attached code

Note: NI does NOT support scripting at that time, so if you have any issue whatsoever with it, you are on your own.

PJM


  


vipm.io | jki.net

0 Kudos
Message 6 of 7
(3,672 Views)
PJM_Labview,

Thanks. That will definitly work. I have no idea where it is located. I am wondering so I can copy it if it is not in a future version of LabVIEW. Thanks again.

Terrill
0 Kudos
Message 7 of 7
(3,666 Views)