When are Activated and Paint event fired?

  • Thread starter Thread starter Ibai Peña
  • Start date Start date
I

Ibai Peña

Hi,
When are Activad and Paint event fired?

This question looks to be trivial(it was for me), but I have seen that is
not so easy.

I have an app with a form, that must be running everytime. The app reads
some data when the form is loaded. What I want is to watch if the data file
has been updated when the app is activated from background. So I try the
form´s Activated event. It doesnt work as I want, becouse is activated when
I click the start menu, and select another app.

So I try form´s Paint event. But I have surprised when I see that happens
the same. The Paint event is raised when I click the start menu, and select
another app!!

1- Why does this happen?
2- Which event can I use for watch if the data file has been updated, when
the app is activated?

Thanks in advance,
 
Hi Ibai,

I did a quick test by simply overriding OnActivated and for me it was not
called when another app was activated, instead it bahaved just as you want.
Perhaps we can help you out if you post some code or a attach a project. I
simply put the following function in the base form...

protected override void OnActivated(EventArgs e)
{
base.OnActivated(e);
}

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top