Home All Groups Group Topic Archive Search About

determining current winform application is active, has focus or being used

Author
19 Oct 2006 3:47 PM
c_shah
VB 2005 and windows form application

I am having difficulty putting my question into words but..

Is there a way to determine whether my win form application has focus
or it is active or being used?

Author
19 Oct 2006 4:41 PM
c_shah
I think I should have give some more information

I want to refresh my application's underlying datasources (DataSet and
Object Collection) periodically
to reflect underlying database changes.

I have put a timer on the form which will call a sub procedure to
update the application's underlying datasources. I just want to make
sure that if the current application is being used just skip the call
to subprocedrue to update datasources.
Author
19 Oct 2006 6:10 PM
stevenhaochen@hotmail.com
Try (VB 2005)
System.Windows.Forms.Application.OpenForms

c_shah 写道:

Show quoteHide quote
> VB 2005 and windows form application
>
> I am having difficulty putting my question into words but..
>
> Is there a way to determine whether my win form application has focus
> or it is active or being used?
Author
19 Oct 2006 6:36 PM
c_shah
It will give me whether the form is open or not?

I want to know whether you have focus on the form (by mouse or
keyboard).