Check to see whether a form exists at runtime
If you want to check whether a form exists in your project at runtime
you can use the following method, you will need to ensure that you
import System.Reflection in order for this to work.
Please note the reason that we are using Assembly.GetEntryAssembly rather than Assembly.GetExecutingAssembly is that if we was to put our code into a DLL for example, then the executing assembly would be the dll which in most cases wouldn't contain the forms. Obviously if your forms and the code that gets the form are held in the DLL then you would want to use Assembly.GetExecutingAssembly.
Last Updated (Thursday, 05 August 2010 16:19)


