Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Windows event fires when you un-hide a form?

For various reasons, I've got a form in an app that needs to remain opened all the time (mostly because users want any data they type there to be "remembered" by the form)... so I allow them to hide it only.

I had THOUGHT that adding a "shown" event would allow me to fire some code every time they re-displayed the form, but now I see that the Shown event only fires ONCE during the form's lifecycle.

What event fires when you do another "Show()" on the hidden form?

like image 276
DaveyBoy Avatar asked Sep 02 '25 17:09

DaveyBoy


2 Answers

You need the VisibleChanged event
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.visiblechanged%28v=vs.110%29.aspx

like image 194
Hans Passant Avatar answered Sep 04 '25 18:09

Hans Passant


You need the Activated event.
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.activated(v=vs.110).aspx

like image 27
George Vovos Avatar answered Sep 04 '25 19:09

George Vovos