LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference to RichTexBox

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.

kcs_pk_0-1594628398828.png

 

Best regards

PK

 

 

0 Kudos
Message 1 of 7
(2,095 Views)

Your reference is the container of the RichTextBox.

Drop a RichTextBox on the front panel, the terminal on the diagram is the reference.

 

George Zou
0 Kudos
Message 2 of 7
(2,047 Views)

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.

0 Kudos
Message 3 of 7
(2,043 Views)

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?

0 Kudos
Message 4 of 7
(1,998 Views)

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?

 

George Zou
0 Kudos
Message 5 of 7
(1,986 Views)

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.

0 Kudos
Message 6 of 7
(1,977 Views)

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 ...

 

George Zou
0 Kudos
Message 7 of 7
(1,971 Views)