07-13-2020 03:21 AM
Hi,
I have an Richtextbox created from reference. How can I access .NET properties and methods? I am not able to change type to specific .NET object.
Best regards
PK
07-13-2020 04:07 PM
Your reference is the container of the RichTextBox.
Drop a RichTextBox on the front panel, the terminal on the diagram is the reference.
07-13-2020 04:14 PM
George is correct that you need to use the reference it creates after putting it on the front panel, but I also see that you're asking about .NET functions but the screenshot you are showing is for an ActiveX container. Did you actually want ActiveX or .NET? They are different things.
07-15-2020 12:38 AM
Actually, ActiveXContainer is the reference of Richtextbox (RTB->Create->Reference) .
My target is to Create the Richtextbox on front panel during runtime. This is done in my original post and it works. I can then move it and resize.
But the question is how to then access the methods and properties of the Richtextbox (or any other object) which is inside the ActiveXContainer?
I tried to cast it to more specific type, but this is not working.
Or maybe I could try to ask in a different way: I will put RichTextBox on the front panel during design. Then I will search for it in the VI by using "Open VI Object Reference". Then I got it, how can I access its properties and methods?
07-15-2020 01:19 AM - edited 07-15-2020 01:20 AM
That's because ActiveX/.Net are not normal/native LabVIEW object.
It's like a cluster. You can right click and create a refnum to the cluster, and move/resize the cluster. But if you want to access the properties of a ctrl inside the cluster, you have to get the refnum of the ctrl first.
I don't see an easy way to get the refnum of the ActiveX/.Net object inside the container from the refnum of the container.
If you put the RichTextBox in the develop mode, why not just use the terminal of the object?
07-15-2020 01:51 AM
I need to create multiple richtextboxes (amount is decided during runtime) and connect them to another controls by scripting. I can do that, but there is this type issue which prevents me to access methods from richtextbox. And I am not able to find a way how to retype it properly.
07-15-2020 02:06 AM
LabVIEW VI is like a template. You can add ctrls in the FP at develop mode. but no easy way to add ctrls (not just ActiveX ctrl) at runtime.
Could you create multiple VIs instead?
For example, you need 3~5 ActiveX ctrls on the front panel.
You can create 3 VIs, one for 3 ActiveX ctrls, one for 4 ...