LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show Labview VI as child in C# Windows

Is it possible to display the Labview VI as a child window in a C# windows based application?

 

The requirement is  -  " There is a  windows based application written in C#, and some Labview VI's for communicating with devices. We need to open(view) these LabView VI's inside the C# Application as child windows.  "

 

0 Kudos
Message 1 of 4
(3,751 Views)

Hm, i doubt that this works out directly. I am not aware that you can include another application into the panels of the calling application as child windows.

WHat you can do is to compile the application you want to "embedd" as ActiveX Server or .NET assembly. Reason is that these two interfaces enables embedding (OLE-part of ActiveX for instance; OLE stands for "object linking and embedding").

So i would compile the LV part of the application as ActiveX dll and embedd it into a window of the .NET application.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(3,747 Views)
I am not sure there's an easy safe way to accomplish this. The best thing might be to pop up floating LabVIEW dialogs instead of embedding them into the parent window.

One odd solution would be to have the LabVIEW code publish it's front panel as a web page and use a simple browser control in C# to view it.
Jarrod S.
National Instruments
0 Kudos
Message 3 of 4
(3,733 Views)

Making one window be the parent of another is actually pretty easy to do with a simple call to the Windows API. SetParent takes a handle to each of the windows and getting the handle is simple (using FindWindow) if you know the window title. If you search here for "MDI" you should find some example VIs which can even show you how it's done, although that's less relevant if you're calling the reparenting code from the C# app.

 

Note that some people had various problems with reparenting LV windows, so you really might want to consider the other option mentioned here, of publishing the FP and using a browser control to access it.


___________________
Try to take over the world!
Message 4 of 4
(3,719 Views)