We are converting a Visual Basic 6.0 application to vb.net 2008 and are having an issue, while executing the code under “form activated event”. There is a difference in behavior between form.activate in Visual Basic 6.0 and form.activated in vb.net. In Visual Basic 6.0, the Activate event was raised only when switching between forms in the application; in Visual Basic .NET, the Activated event also is raised in case of showing messagebox and when switching from other applications.(by msdn)
In vb6 application the purpose to use form activate event is, to execute some code when forms become active. In our application forms are loaded, hide and show in different flows. So whenever this form is shown from hide state or any of its child form return focus to it, we need to reflect different changes in the application to the specific form controls.
* For example user changes its application preferred language.
* As the application is huge, so shifting logic to other place with respect to the current scenario might solve the problem for the current form but then I have to re think it for all other forms (which is very hectic and more or less not feasible).
In the migration process it is required to make as little changes in the existing code execution hierarchy. So we need a similar behavior like form.activate in vb6.0 with some other event or restrict some functionality of Activated event in vb.net.