UI Interest Group Discussions

Showing results for 
Search instead for 
Did you mean: 
Reply

Show a front panel in a Windows app?

Highlighted

Show a front panel in a Windows app?

I attended the Dev Day today and was inspired to take a new look at the possibilities for a Labview UI.  Does anyone have an idea on how I could display a VI front panel from a Windows Forms app (or a WPF app for that matter)?  I'm sure there's a way to show it as a pop-up, but what about containing it within a form (like a subpanel)?

Thanks ahead of time.  By the way, I think these community groups are a great way to share ideas between devs, and I look forward to reading more about the neat things that I can do (and never realized) with Labview.

0 Kudos
Message 1 of 5 (4,225 Views)
Reply
0 Kudos

Re: Show a front panel in a Windows app?

Hello,

You might want to take a look at the example code posted by Arnoud de Kuijper in this thread: Dock windows system in LabView.

I think that Arnoud's example does what you want to do. His example brings up sub-panels inside of another VIs window, but I'm guessing that you could also use his method to target any window.

Hope this helps.

Mark Ridgley

0 Kudos
Message 2 of 5 (18 Views)
Reply
0 Kudos

Re: Show a front panel in a Windows app?

0 Kudos
Message 3 of 5 (18 Views)
Reply
0 Kudos

Re: Show a front panel in a Windows app?

strimble,

Nice to meet you at the DevDays session yesterday.  I thought a little about your question and think I'm at least on the right path.  I've attached a Visual Studio solution (VS 2010 - sorry it's all I have) with a C#/Windows Forms app that launches a VI and embeds it's front panel in a panel on the form (just like a subpanel in LabVIEW).

2010-04-30 14 55 56.png

I've tried to document my code and it's far from pretty/perfect but I hope it helps get you started.

In case you can't open the code I basically just run the VI normally then use user32.dll to make the front panel window a child of a panel on my form and resize it to be an exact match.  I then make another couple of user32.dll calls to hide the border and titlebar of the front panel so it appears embedded.

~SimonH

0 Kudos
Message 4 of 5 (18 Views)
Reply
0 Kudos

Re: Show a front panel in a Windows app?

Thanks for your help, Simon!  This looks like a good starting point.

0 Kudos
Message 5 of 5 (18 Views)
Reply
0 Kudos