04-29-2010 06:06 PM
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.
04-30-2010 09:06 AM
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
04-30-2010 09:54 AM
Here's a link from a coworker who works with WPF.
http://stackoverflow.com/questions/765365/create-a-transparent-hole-inside-a-windows-background-wpf
04-30-2010 02:56 PM
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).
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
05-05-2010 08:10 AM
Thanks for your help, Simon! This looks like a good starting point.