PC Review


Reply
Thread Tools Rate Thread

When are Activated and Paint event fired?

 
 
Ibai Peña
Guest
Posts: n/a
 
      2nd Oct 2003
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,

--
Ibai Peña
Movetek Integración Móvil


 
Reply With Quote
 
 
 
 
Geoff Schwab [MSFT]
Guest
Posts: n/a
 
      6th Oct 2003
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.

"Ibai Peña" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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,
>
> --
> Ibai Peña
> Movetek Integración Móvil
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event object is null when event is fired. WebUserControl ASP.NET/AJAX Matt Michler Microsoft C# .NET 0 28th Aug 2007 09:53 PM
Search of an event fired immediate before Quit-event Peter Ostermann Microsoft Outlook VBA Programming 4 6th Apr 2007 07:46 AM
Event from ocx was not fired Norbert Schiller Microsoft Access ADP SQL Server 1 11th Sep 2006 01:37 PM
event not fired !! Pohihihi Microsoft C# .NET 0 9th Dec 2005 10:01 AM
Calling Web Service in DragDrop event causes event to be fired multipletimes Vincent Mouton Microsoft Dot NET Framework Forms 0 18th Mar 2005 07:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:41 PM.