have a child while parent is not accesible
-
hi, i apologize for asking this simple question but i should ask it because i am not familiar with the terminology to search in the internet i want to have a child form, and i know how to do it but i don't want the parent form be accessible when the child exists please tell me what can i do? here is the code i used for my child form
Form2 myChildForm = new From2();
myChildForm.MdiParent = this;
myChildForm.show(); -
hi, i apologize for asking this simple question but i should ask it because i am not familiar with the terminology to search in the internet i want to have a child form, and i know how to do it but i don't want the parent form be accessible when the child exists please tell me what can i do? here is the code i used for my child form
Form2 myChildForm = new From2();
myChildForm.MdiParent = this;
myChildForm.show();Are you talking about modal and non-modal/modeless forms? Form.Show() will create a modal dialog. Form.ShowDialog() will create a modeless dialog. Link[^] I am confused as to why you are setting MdiParent - I doubt you can make the parent unusable when an MDI child is open. This should work for you:
Form2 myChildForm = new From2();
myChildForm.ShowDialog();Cheers, Vıkram.
Carpe Diem.
-
Are you talking about modal and non-modal/modeless forms? Form.Show() will create a modal dialog. Form.ShowDialog() will create a modeless dialog. Link[^] I am confused as to why you are setting MdiParent - I doubt you can make the parent unusable when an MDI child is open. This should work for you:
Form2 myChildForm = new From2();
myChildForm.ShowDialog();Cheers, Vıkram.
Carpe Diem.
No, the ShowDialog will create a mode dialog, but the Show will create a non-mode dialog. The mode dialog means that others form can not be operated.
-
Are you talking about modal and non-modal/modeless forms? Form.Show() will create a modal dialog. Form.ShowDialog() will create a modeless dialog. Link[^] I am confused as to why you are setting MdiParent - I doubt you can make the parent unusable when an MDI child is open. This should work for you:
Form2 myChildForm = new From2();
myChildForm.ShowDialog();Cheers, Vıkram.
Carpe Diem.
thank you for your good answer just exactly what i wanted and you learned me the terminology but in real you told me the terms modal, and non-modal exactly vice versa Show() will create a non-modal and ShowDialog() will create a modal if you are in shake just check the modal dialog in the wikipedia ;) thanks a lot
-
thank you for your good answer just exactly what i wanted and you learned me the terminology but in real you told me the terms modal, and non-modal exactly vice versa Show() will create a non-modal and ShowDialog() will create a modal if you are in shake just check the modal dialog in the wikipedia ;) thanks a lot
Name Description ShowDialog()()() Shows the form as a modal dialog box with the currently active window set as its owner. ShowDialog(IWin32Window) Shows the form as a modal dialog box with the specified owner. From the MSDN website. http://msdn.microsoft.com/en-us/library/system.windows.forms.form.showdialog.aspx
-
Name Description ShowDialog()()() Shows the form as a modal dialog box with the currently active window set as its owner. ShowDialog(IWin32Window) Shows the form as a modal dialog box with the specified owner. From the MSDN website. http://msdn.microsoft.com/en-us/library/system.windows.forms.form.showdialog.aspx
thank you merci
-
thank you for your good answer just exactly what i wanted and you learned me the terminology but in real you told me the terms modal, and non-modal exactly vice versa Show() will create a non-modal and ShowDialog() will create a modal if you are in shake just check the modal dialog in the wikipedia ;) thanks a lot
Hey, glad to help you man :) Yeah, I guess I got my answer mixed up though.
Cheers, Vıkram.
Carpe Diem.