06-15-2020 06:23 AM
Hi,
I'd like to know how to use scripting to add RichTextBox .NET RichTextBox.
My target is to create .net RichTextBox with New VI Object. I know how to add a .NET Container, but I am not sure how to cast it to .NET object class, so I can load the .NET library.
The reason to do it by scripting is to create user defined number of RichTextBox controls dynamically.
Anyone knows how to do it? Generic there is because I can't find .NET Container there.
PK
Solved! Go to Solution.
06-16-2020 01:10 AM
It doesn't look like the .NET container gets its own dedicated class. If you create a reference from a .NET container, its class is an ActiveX container, which at least in LV 2015, only seems to have a couple of private properties and methods which don't include selecting the object type.
One useful trick for scripting, which can probably work here, is to use the cooking show method of "here's one I made earlier" - manually create and save a VI with the code you want, then move or copy that over to your target VI using the relevant scripting methods. This is generally useful, because it can save a lot of tedious scripting for stuff which is fixed.
06-16-2020 02:53 AM
Thanks for the direction. VI->Create from Reference actually helped.