0
Thanks Sam. I thought I had it working beacuse my dialog was no longer minimized. The actual code I use now is
Form1 frm1 = new Form1();
Form2 frm2 = new Form2();
frm2.ShowDialog(frm1);
Thanks again everyone =)
0 Note that Show will show the form modeless. If you want modal then use ShowDialog. Modeless means that both the form shown and the form that shows can be used. Modal means that the form that is shown must be closed before the showing form can be used again.
0 I got it working!
I started a new project
Named everything the same
and used the same code......This time it worked!
I probably messed up a naming reference deep in the project or something.
Thank you for all your help.
And if there are any newbies(like me) here is the syntax i used to show a form
as a dialog controlled by another form.
Form1 frm1 = new Form1();
Form2 frm2 = new Form2();
frm2.Show(frm1);
Place above code in a button (or some other control)
Thanks again everyone. =)
0
I don't know what your frmFileImport class is but you probably want to use the OpenFileDialog class instead. There are many samples of using it. The OpenFileDialog.Show method will show the dialog modal the way you need to. You probably need to use the OpenFileDialog in your main form; add a handler for the form load event to your main form and show the OpenFileDialog there.
0
Thanks for the reply. Unfortunatly I have checked windowstate. That's kind of what concerns me too. I feel it must be a property of one of the forms. I can set the windowstate to any value, even maximized and it always loads in minimized state. I think it does this because it creates a new instance of the form and maybe wipes out some properties. I have programmed in VB for years and I guess I dont understand why you have to create a new instance of a form you have already designed. I will research that on my own(i realy like C# too), but for now I'm going to try to get this owner window thing working. Thanks again for your help
0 hi mark,
I created the application with your code, its working fine, but if your filedialog page getting minimized, then plz check the windowstate property of the filedialog form and change it to normal
please do let me know what you have done to solve your problem