LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding controls dynamically

Hello everyone,
 
I've done a quick search about dynamically adding a control (e.g., textbox, chart) to a form using Labview, but most of the messages indicate that it was not possible or very difficult to do.  I would like to generate a new tab on a tab control with a variable number of controls (e.g., text boxes, buttons) to dynamically display results.  Is it also possible to connect code to the button, so that a new form is loaded?  Is this possible using Labview 8.5? 
 
There's some discussion about making a GUI using a picture control and processing mouse clicks.  However, this does not scale to comboboxes and other controls. 
 
 
Thanks
 
Will
0 Kudos
Message 1 of 5
(3,529 Views)
Unfortunately, there are some limitations, and dynamically creating controls is one of them. If you can't create controls dynamically, then you can't "connect code to the button". The situation isn't any different in 8.5, otherwise it would be well known. It's not something that's likely to be kept secret.

Note: The above does not take into account the use of scripting.
0 Kudos
Message 2 of 5
(3,523 Views)

HI Will,

Please post some images of what you want to acheive so we can help out. I have been making a living (well almost) of creating apps that require an unspecified GUI and may be able to help out.

Just trying to help,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 5
(3,517 Views)
Here's what I have in mind.  The following sets of controls will be generated (arbitrary number) similar to records in a database.  There is a list box that contains data associated with each record.   A set of buttons would be used to add, remove, move up and move down the data in the list box.
 
So it would look like this,
 
Record #1
  
    Data          List Box
    Add
    Remove
    Up
    Down
      
 
Record #2
  
    Data          List Box
    Add
    Remove
    Up
    Down
 
Record #3
  
    Data          List Box
    Add
    Remove
    Up
    Down
 
Although I am familiar with other languages, Labview is still completely new to me.
 
Thanks
 
Will
0 Kudos
Message 4 of 5
(3,493 Views)
It seems to me that a better way to accomplish this is to use a table or a multicolumn listbox. You can operate on these controls with just a single set of "Add", "Remove", "Move Up" and "Move Down" buttons. You can make visible/invisible the appropriate control based on the selected record/cell.

For example, here's a couple of screenshot from a test list editor where you define parameters for a test. The control that's displayed is based on the type of parameter.

The first is for an array of enums.


The second is for a floating point.




If you wanted in-place editing there's tricks for that as well.


Message Edited by smercurio_fc on 06-13-2008 01:20 PM
Download All
0 Kudos
Message 5 of 5
(3,486 Views)