Jump to content

Programmaticlly load controls


Recommended Posts

Hi to All,

Happen that I need to create unknow numbers of controls in my application front pannel.

I wish I can programmatically load custom controls without know the number of them before to create my front pannel.

Example: I want to create custom controls that take his property from text file; each line in text file is one control, the controls are grouoping in cluster of controls. I know that I easy create an Array-Controls that contain my custom controls and that I can insert it in TAB-Page of TAB-Control but, how I can add Tab-pages as first one I created if user add cluster controls in text-file?

For this kind of problems I wish NI will add some methods that can help developer for programmatically add controls to application front pannel as other oop programming languages.

Thank to all, and sorry for my english.

Link to comment
  • 2 weeks later...

This wish has beend posted several times before, and the answer was always: we can't do this, because there is no way to connect controls to a wire at runtime (e.g. because there is no block diagram at runtime ...). My assumption is: even with the newly released scripting there is no way because scripting will not work at runtime, just at development time.

Unless this task is easy to do in other programming languages, it will be hard to archive in LV, because IMHO this would require something like Objects by reference (in the C++ or C# sense of Object)

Link to comment

QUOTE (i2dx @ May 30 2009, 09:28 AM)

My assumption is: even with the newly released scripting there is no way because scripting will not work at runtime, just at development time.
That is correct. Scripting requires recompilation, and there is no compiler in the runtime engine.

Your best option is an array of controls... you can resize the array at runtime to display more or fewer controls.

Link to comment

QUOTE (Aristos Queue @ May 30 2009, 09:28 AM)

That is correct. Scripting requires recompilation, and there is no compiler in the runtime engine.

Your best option is an array of controls... you can resize the array at runtime to display more or fewer controls.

And you COULD even wrap that functionality into a VI that was called "Create..." and feed in which control to expose....

Kind of make an object out of if desired.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.