LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic creation of control

Hi is it possible to create control buttons in run time based on the input given by the user.Do any one have the demo program
0 Kudos
Message 1 of 7
(4,381 Views)

You can't.  You can only show previously-created (Edit-Time) controls.

 

LV does not support control creation on-the-fly.

 

Shane.

Message 2 of 7
(4,376 Views)

Intaris a écrit: You can't.  You can only show previously-created (Edit-Time) controls.

 LV does not support control creation on-the-fly.


 The answer is a bit more complicated. See a discussion of the same question here 😉
Message Edité par chilly charly le 09-18-2008 08:20 AM
Chilly Charly    (aka CC)
Message 3 of 7
(4,368 Views)

Yes, but that's not strictly creating controls, is it?  It's mimicing controls.

 

It's certainly a nice feature to have when you come up against a fundamental limitation of LV, but I think someone who is not yet aware of the fact that LV in itself does not support dynamic control creation should try first to write code in a way that is compatible with this....

 

Shane.

Message 4 of 7
(4,360 Views)

Intaris a écrit:  Yes, but that's not strictly creating controls, is it?  It's mimicing controls.

 It's certainly a nice feature to have when you come up against a fundamental limitation of LV, but I think someone who is not yet aware of the fact that LV in itself does not support dynamic control creation should try first to write code in a way that is compatible with this....


My point of view is different. When somebody ask a question, for which there is indeed a solution, I'll try to avoid saying "No, there is no solution". I'll balance my reply to take into account "environment" parameters (difficulty, cost, time, compactness...). As a university professor, this is a situation I have to face with my students on a daily basis. And, from experience, I found it is most often more rewarding for everybody to say "Yes you can...but...". It leaves the parter the possibility to decide himself if the solution fits his needs.
In the specific case of LabVIEW limitations, I also think that it is better to acknowledge the limitation and propose a workaround (= a way to write code that is compatible with the problem) that is most often more efficient than the way the "customer" was considering. 😄
There are no problem, just solutions 

 

Message Edité par chilly charly le 09-18-2008 08:47 AM
Chilly Charly    (aka CC)
Message 5 of 7
(4,353 Views)

OK, I don't want to start a philosophical discussion here.

 

The original question was how to generate controls on-the-fly.  This is not possible, but a simulation of this is possible via the link you provided.

 

It's now up to the original poster to decide which way is easier for him, adapt his UI to work with pre-determined controls (maybe be hiding and showing to give the illusion of creation) or using a toolkit to mimic the creation of controls.  Both ways are valid, but as to which way is best, that's an individual opinion.

 

Shane.

Message Edited by Intaris on 09-18-2008 01:50 AM
Message 6 of 7
(4,350 Views)

"Been there, doing that"

 

Speaking as a developer that has been developing in LV for about ten years and have helped pioneer the "Create the Control on the Fly" (CCOF) concepts AND being nine months into the the ultimate CCOF project (app has only two Picture Control on FP!* ) I can say,

 

"The simplest solution is the best solution."

 

If there is an easier wasy (like hiding/showing controls) then use that approach.

 

BTW: My NI Week paper on this topic was rejected. Go figure. Smiley Surprised

 

Ben

 

* It does give one a very good appreciation of what NI has given us with LV though. Smiley Wink

Message Edited by Ben on 09-18-2008 06:01 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(4,310 Views)