Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Switching form
 

Switching form

  I have 2 forms in my application , when i click sign In button on first from , i hide that form & open second form , but when close second form ,first form still is running (its invisible) & calling dispose method doesn't work. ,.What code should i write in closing second form?

 

MVPatil  Thursday, April 06, 2006 4:51 PM
Hello ManishaPatil

i faced this problem few days ago, so here is my solution

this.Hide();
Form2 f2 = new Form2();
f2.ShowDialog();
this.Close();

// Hope this might help

Ali Raza Shaikh  Thursday, April 06, 2006 5:20 PM

well i inserted that code ,now it opens two same windows of second form

thanx for replying

MVPatil  Thursday, April 06, 2006 5:28 PM

Hello ALI RAZA SHAIKH

ur code is right ,i accidently created two instance of same form

i got my mistake

thanx

MVPatil  Thursday, April 06, 2006 6:24 PM
Hello ManishaPatil

i faced this problem few days ago, so here is my solution

this.Hide();
Form2 f2 = new Form2();
f2.ShowDialog();
this.Close();

// Hope this might help

Ali Raza Shaikh  Thursday, April 06, 2006 5:20 PM

well i inserted that code ,now it opens two same windows of second form

thanx for replying

MVPatil  Thursday, April 06, 2006 5:28 PM
Two same windows?
Can you post the code you are using?

Ali Raza Shaikh  Thursday, April 06, 2006 5:49 PM

Hello ALI RAZA SHAIKH

ur code is right ,i accidently created two instance of same form

i got my mistake

thanx

MVPatil  Thursday, April 06, 2006 6:24 PM
mark the post as answered

Ali Raza Shaikh  Thursday, April 06, 2006 6:59 PM

You can use google to search for other answers

Custom Search

More Threads

• EventDescriptor and discovering attached handlers?
• EnableDesignMode with collections (Troubles with serialization)
• Custom Control Help! Using a classic C-Style custom control.
• Error message "Type SqlAddapter is not defined"
• Embeded WindowsMediaPlayer has bugs
• VS2005 Designer fails on inherited user control
• Designer Error
• set client area of control that inherits from panel
• getting a control to repaint when designing
• How to create a Multicolumn ComboBox in VB.Net?