How to open new form
-
I have 2 form in my application 'Form1' & 'Form2' 'Form1' is main form how i can show 'Form2' from 'Form1'? with this code i cant do this job.
Form2.ActiveForm.Show();
Hi Create an instance of Form2:
Form2 form2 = new Form2();
Then, use either:
form2.Show();
or
form2.ShowDialog();
---------------------------- Be excellent to each other :) EasiReports[^] My free reporting component for WinForms.
-
I have 2 form in my application 'Form1' & 'Form2' 'Form1' is main form how i can show 'Form2' from 'Form1'? with this code i cant do this job.
Form2.ActiveForm.Show();
Using some event to call it up (command button, etc.) or just opening in your constructor of form one: System.Windows.Forms.Form form2 = New myNamspace.Form2; Form2.show(); Brettski
-
Using some event to call it up (command button, etc.) or just opening in your constructor of form one: System.Windows.Forms.Form form2 = New myNamspace.Form2; Form2.show(); Brettski
-
I have 2 form in my application 'Form1' & 'Form2' 'Form1' is main form how i can show 'Form2' from 'Form1'? with this code i cant do this job.
Form2.ActiveForm.Show();
Form2 frm = new Form2(); frm.Parent = this; frm.show()
Divyang Mithaiwala System Engineer & Software Developer
-
Seeing as this is a C# forum, that code wont compile like it will in VB.NET I am guilty of the other way round, I always manage to post C# in the VB forum - and it always gets pointed out to me. :-D
It wont? Please explain? It's what I use and I don't use vb.net. Thank you, Brett