Control hiding question

  • Thread starter Thread starter baramuse
  • Start date Start date
B

baramuse

Hi there ! :)


I was wondering if there were any event to notify a control that it is
not drawn anymore...

My application has a numbers of panels switched by the user, and one of
them, for example, let the user know a few things about his wifi
connection...

I thought of lauching a thread to refresh the wifi infos but when this
panel is not drawn anymore, I would like to pause the thread for
preserving system ressources...

Any ideas?

Thanks in advance !
 
When you move a panel to the "background" set it's visible property to
false, then you can simply query that.

<ctacke/>
 
When you move a panel to the "background" set it's visible property to
false, then you can simply query that.

<ctacke/>
oh, i didn't knew thah :)

I thought the visible property was just set manually..
But as we are in CF there isn't the VisibleChanged event anymore ;(
Is it easyli implementable? :$
 
Somewhere in your code you're moving the panle to the back. At that point,
set it's visible property to false. Then in you update thread, before
posting the data, simply check that property, or better yet when you change
the the panel's visibility, call ThreadEx.Suspend or Resume as appropriate.

<ctacke/>
 
Somewhere in your code you're moving the panle to the back. At that point,
set it's visible property to false. Then in you update thread, before
posting the data, simply check that property, or better yet when you change
the the panel's visibility, call ThreadEx.Suspend or Resume as appropriate.

<ctacke/>

In fact I'm not realy moving the panel to the back, I actually send the
panel I want to swho to the front (with SendToFront) :)
So I cannot really know when a panel has been hidden...
I'm starting to think that I'm wrong from the begining :(
 
Checking the Visible property from a thread may prove tricky. I would
suggest maintaining an ArrayList that would shadow the Z-Order
 
Back
Top