How can i hide my second form dialog without bliking form not closing my first form?
Sorry guys the title shoud be this
How can i close form1 with button exit to show form2 without bliking form - After i click close program it shoud close form2 and show again form1 as normal form with position ?
I am using Visual studio 2013. I created two forms, form1 with a button to open form2 and the form2 has a button "exit" which will take me back to form1
This is my code i have for so far.
Code:
Form2.StartPosition = Windows.Forms.FormStartPosition.Manual
Form2.Bounds = Me.Bounds
Form2.ShowDialog()
button exit close form1 and show form2 - After i want to close form2 it shoud close form2 and show form1 again as normal form.
http://111.imagebam.com/download/UxU.../metro%209.jpg
Thanks in advance guys ;)
Re: How can i hide my second form dialog without bliking form not closing my first fo
Um, no, closing Form2 is not going to close Form1. Form1 will only close if you close it, which that code does not do. If you want to hide Form1 before showing Form2 then call Form1's Hide method. If you want show Form1 again after Form2 closes then call Form1's Show method.
Re: How can i hide my second form dialog without bliking form not closing my first fo
what about
Code:
Form2.Show()
Form1.Hide()
Re: How can i hide my second form dialog without bliking form not closing my first fo
You didn't understand what i want.
I do not wanna hide it i just wanna close form like in other programs.
When i click x button to close form2 it should close not all forms but only form2 and back to form1 as it was.
How to do that ?
I know that it is really possible and i know that my code just set position after i open form2 it's ok but i need code to not hide but close form not all program.
Re: How can i hide my second form dialog without bliking form not closing my first fo
Change the Application Shutdown Mode to 'When last form closes'. Then after showing form2 you can close form1.
If you want from2 to show form1 when it closes then show form1 in form2's FormClosing event handler.