Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Loss of application focus after adding Vision viewer

When developing an application using MS Visual Studio .NET 2003 or 2005, Win NT or WinXP and adding a NI Vision 8.0 ActiveX Viewer control to the form upon execution the form losses focus (active window). This behavior is noticed on a newly created application with only the Viewer added before compiling and running. Before adding the control the application preforms normally. Is there something in the Viewer properties that can change this behavior or is there something else I should be doing?
John A. Lively
NDE Engineer
Pratt & Whitney
0 Kudos
Message 1 of 4
(3,196 Views)

Hello Pratt,

I was hoping you could clear up some terminology in your last post.  What exactly are you referring to when you say the form loses focus?  Are you saying the window goes inactive?  Could you try attaching a screenshot?  In regards to the question you posted, have you tried running one of the packaged examples that come with Vision for .NET?  They can be found at: C:\Program Files\National Instruments\NI-IMAQ\Sample\MSVB.NET

You might want to try and see if you get the same behavior with these applications.  Also, using the search engine on our main website http://www.ni.com with the keywords “IMAQ display .NET”, I was able to find a Developer Zone tutorial titled IMAQ Acquisition, Images, and Displaying in Visual Basic, which is directly linked here: http://zone.ni.com/devzone/cda/tut/p/id/3473

This page provides information regarding how to display images with links to other example code.  You might also want to take a look here for further information regarding Vision with .NET. 

Hopefully this helps answer your question.  If you would like further clarification or information, please let us know.

Regards,

Vu D


Applications Engineer

0 Kudos
Message 2 of 4
(3,172 Views)
Yes as soon as the application is started the application becomes inactivate and the previous application becomes active. I compiled the ReadImage example from "Vision/examples/MSVB.Net/Getting Started" with Vision V8.0, MS .Net 2005 and Win XP. I executed by double clicking the executable from Explorer. The application become inactive as soon as it is started. Explorer is the active application and is on top of the ReadImage application. This is the same problem I am having with my applications.
John A. Lively
NDE Engineer
Pratt & Whitney
0 Kudos
Message 3 of 4
(3,168 Views)
Hello Pratt,

This behavior has actually been documented as a Bug in Vision 8.0.  When ever you use the CWImaqViewer it will shift the focus onto a previous application when run.  A fix for this bug was made in the next version of Vision (8.2).  If you have purchased Vision 8.0 then you will be able to upgrade to Vision 8.2 for free.  Instructions about upgrading to Vision Development Module 8.2 can be found HERE.  Sorry for the inconvience.  Let us know if you have anymore questions.  Thanks and have a great day.

Regards,
Mark T
Applications Engineer
National Instruments
Message 4 of 4
(3,134 Views)