My objective is to instanciate my own windows forms on the fly based on some
registry settings.
where in the visual studio project can I write this code? I need to know
where does the application starts loading...
In C#, it's the Main method. If you look inside the code for your main
Windows form, you will see that the Designer has created a static
method called Main. (It's probably called something different in VB,
but there will be a corresponding method in VB. There has to be.) If
you examine the code in that method, you will see it calling
Application.Run and passing a constructed instance of the main form
that the Designer created for you when you created the Windows Forms
project.
The way I see it, you have two choices.
1. If you want your application to start up with a different main form
depending upon registry settings, then do the registry lookup in the
Main method, and change the Application.Run() call to pass in an
instance the appropriate form, based on the registry settings.
2. If you want your application to start with the main form that you
created in the designer, but then after that to bring up different
forms based on registry settings, then do the registry lookup wherever
you need to in your main form's code. I doubt this is the case, though,
based on the phrasing of your question.