06-24-2011 12:34 PM
Hi is there any way that I can take data from user in variable number of controls. Say in one main control I take data from user that says 4, so 4 more control should get activated in which I can take different data. Or if say user enters 15 in the main control, so 15 new control should popup while the vi is running. I know there is a way to activate and deactivate a control using property node right, but that makes the number of control that should pop up limited. So if there is any way please suggest
06-24-2011 12:44 PM
This question has been asked MANY times. You cannot add/remove controls at run-time. This is effectively the same as having an application modify itself while it's running. There are alternatives, such as having a max number of controls, and then simply making them visible/invisible. Or, having the "control" be a subVI, and you can create multiple instances of that VI by using a VI template or making the VI re-entrant and then dynamically calling it. Depending on what you're trying to do, you make be able to use an array instead of individual controls.
06-24-2011 12:48 PM
Try using a table. You can resize the table as required. If you want to use ENUM controls, you can use a single ENUM control of each type, and move it to the selected cell (column, row) on the fly.
You can do the same thing with a picture. The controls can be text or image on the picture until the mouse is positioned over one and then you move the control to that position, load the value in it, and make it visible.
06-24-2011 12:54 PM
It you want to take the approach mentioned by david.
See this thread for links to picture related threads.
Ben
06-25-2011 07:08 PM
I did this.