Windows Develop Bookmark and Share   
 index > Windows Forms General > How to open existing 2nd form (not a new form) from the 1st form in C#?
 

How to open existing 2nd form (not a new form) from the 1st form in C#?

I have created 2 forms, StockOrder.cs & NewOrder.cs, & I have put a button on the StockOrder form called "New Order".
How do I get the NewOrder form to open when I click on this button I've placed in StockOrder & at the same time hide this form?

Also, I would like to place a "Return" button on NewOrder form that allows me to go back to StockOrder form. How do I do that?
greatkev33  Sunday, October 04, 2009 7:56 AM

use this

this.Visible=false;
form2.ShowDialog();
this.Visible=true;

  • Marked As Answer bygreatkev33 Monday, October 05, 2009 8:17 AM
  •  
Bharath kumar Y.S  Monday, October 05, 2009 3:33 AM
First of all, I don't think it is a good idea to hide the StockOrder. 2nd of all, I think you should ask your classmates this question, I think on of the threads below is started by them as well:

Thread 1
Thread 2
Thread 3

...

Please, next time, search first before you post a new question.
Geert van Horrik - CatenaLogic
Visit my blog: http://blog.catenalogic.com

Looking for a way to deploy your updates to all your clients? Try Updater!
Geert van Horrik  Sunday, October 04, 2009 9:44 AM
Use ShowDialog().

Hans Passant.
nobugz  Sunday, October 04, 2009 12:44 PM

use this

this.Visible=false;
form2.ShowDialog();
this.Visible=true;

  • Marked As Answer bygreatkev33 Monday, October 05, 2009 8:17 AM
  •  
Bharath kumar Y.S  Monday, October 05, 2009 3:33 AM

You can use google to search for other answers

Custom Search

More Threads

• Custom radiobutton control help please
• drawing graphics, need to resize client area?
• Window form start location
• Using C# user control in VB 6.0
• how to pass Parameter value from one page to another
• arrays of classes in C++ windows forms
• Cool App
• Sequence Of Events
• MDI toolbar displayed under Parent toolbar like VS 2005
• NodeMouseDoubleClick event, weird behavior.