I have two forms first is frmBase and second is frmBalloon.I alter the focus of both forms that first frmBase is shown then frmBalloon is shown(frmBase is not visible)and then again frmBase is shown.Now I have need of event that occurs first frmBase loads and then again when it shows after frmBalloon becomes not visible.
So I have need of event that occurs when form becomes focused…….
Is
Form.Activatedwhat you’re after?My reason for suggesting this rather than
GotFocusis that the form itself doesn’t get focus if the focus changes from one form to a control on a different form. Here’s a sample app:(Build this as a console app – that’s where the output goes.)
Put some name in the text box and click “new form” – then do it again. Now click between the text boxes on the new form – you’ll see the
Activatedevent is getting fired, but notGotFocus.