public MainFrm()
        {
            InitializeComponent();

            //Added to support default instance behavour in C#
            if (defaultInstance == null)
                defaultInstance = this;
        }
 static void defaultInstance_FormClosed(object sender, FormClosedEventArgs e)
 {
     defaultInstance = null;
 }