Monday, August 24, 2009

Winforms keeping a dialog open but hidden

You can keen a windows form open but hidden bringing it into focus on demand as follows:

  • Declare it in your main class
RFCManager rfcmanager;

  • create it in on form load:
rfcmanager = new RFCManager();
rfcmanager.Hide();

  • When you want to show:
rfcmanager.Show();


  • On the FormClosing Event handler :
this.Hide();
e.Cancel = true;


Enjoy!