ShowDialog
-
hi! :) In the ShowDialog, is there a way to set the modality of the form into a parent form only not to the whole application? i used the ShowDialog(IWin32Window) overload, still it's application modal. but if i use the Show method and disabled the Parent form this solves the problem, but the process of the parent continues after the form is shown. Unlike in the ShowDialog, it freezes the parent's process until you close the modal form. so is there any way to make this somewhat a combination? - Form Modal - freezes the parent's process when the modal form is shown & resumes when it's closed. any suggestions is very much appreciated. thanks in advance! :)
-
hi! :) In the ShowDialog, is there a way to set the modality of the form into a parent form only not to the whole application? i used the ShowDialog(IWin32Window) overload, still it's application modal. but if i use the Show method and disabled the Parent form this solves the problem, but the process of the parent continues after the form is shown. Unlike in the ShowDialog, it freezes the parent's process until you close the modal form. so is there any way to make this somewhat a combination? - Form Modal - freezes the parent's process when the modal form is shown & resumes when it's closed. any suggestions is very much appreciated. thanks in advance! :)
-
i think this can be solved by making the parent form as MDI and the form that u want to display as the MDI child of the parent form. hope that works for u Regards, Pramod
the child form is like a messagebox. that shows message, only modal to the owner/parent form and executes the next statement of the owner after it's close. that's why it doesn't solves my problem. :( i don't use the .Net's messagebox because i want some other controls on it. anyway, thanks for your reply! i really appreciate it! :)
-
the child form is like a messagebox. that shows message, only modal to the owner/parent form and executes the next statement of the owner after it's close. that's why it doesn't solves my problem. :( i don't use the .Net's messagebox because i want some other controls on it. anyway, thanks for your reply! i really appreciate it! :)
-
What actually are u trying to do? if u are using a form to display the message then u can make that message form as the MDI child of the form from where u are calling this message form. if u can explain ur problem in more detail.. Regards, Pramod
hi pramod! :) sorry for the late reply. actually, my main goal is to create a custom message box. I don't want to use the normal messagebox because it's very limited with regards to functionality and design. that's why i just created a normal form. i already read some articles about making a custom messagebox and most of them are using the ShowDialog method. Which is ok because it will become modal to the owner form and the next statement after the showing of the messagebox is executed after the messagebox is closed. but there is a problem in this method... the modality of the messagebox is for the whole application not for the owner only. for example, i have 2 forms in the application, Form1 and Form2. Both of them are loaded. the Form1 shows the messagebox, which means it's the owner and you cannot access it until you close the messagebox. So Form2 must be accessible, but this is not what happen. both of the forms are not accessible. :( there's an overload of the ShowDialog which has an IWin32Window parameter for setting the owner. but it's the same as the one with no parameter. :mad: so as a solution for the modal thing, i just set the owner of the messagebox, then use the Show method and disabled the owner. but there's a problem with this(again?:() the execution of the statements, after showing the messagebox, continues even if the messagebox is stil loaded. so as a summary, here's what i want(if possible...:^)) Option 1 - Use ShowDialog method - Set the modality of the messagebox to the owner only (how???) Option 2 - Use Show method and disabled the owner - freeze the process of the owner until the messagebox close (how???) hope that explains well...:^) thanks for your time! :) microsoc :cool:
-
hi pramod! :) sorry for the late reply. actually, my main goal is to create a custom message box. I don't want to use the normal messagebox because it's very limited with regards to functionality and design. that's why i just created a normal form. i already read some articles about making a custom messagebox and most of them are using the ShowDialog method. Which is ok because it will become modal to the owner form and the next statement after the showing of the messagebox is executed after the messagebox is closed. but there is a problem in this method... the modality of the messagebox is for the whole application not for the owner only. for example, i have 2 forms in the application, Form1 and Form2. Both of them are loaded. the Form1 shows the messagebox, which means it's the owner and you cannot access it until you close the messagebox. So Form2 must be accessible, but this is not what happen. both of the forms are not accessible. :( there's an overload of the ShowDialog which has an IWin32Window parameter for setting the owner. but it's the same as the one with no parameter. :mad: so as a solution for the modal thing, i just set the owner of the messagebox, then use the Show method and disabled the owner. but there's a problem with this(again?:() the execution of the statements, after showing the messagebox, continues even if the messagebox is stil loaded. so as a summary, here's what i want(if possible...:^)) Option 1 - Use ShowDialog method - Set the modality of the messagebox to the owner only (how???) Option 2 - Use Show method and disabled the owner - freeze the process of the owner until the messagebox close (how???) hope that explains well...:^) thanks for your time! :) microsoc :cool:
The first thing that i would like to know is y do u want to display 2 forms at one time in ur application. I think the flow should be such that only one form is accessible at one time. But even then if u want to do it then it seems to be a tricky one need to try this i'll try if this is possible and then let u know Regards, Pramod
-
hi pramod! :) sorry for the late reply. actually, my main goal is to create a custom message box. I don't want to use the normal messagebox because it's very limited with regards to functionality and design. that's why i just created a normal form. i already read some articles about making a custom messagebox and most of them are using the ShowDialog method. Which is ok because it will become modal to the owner form and the next statement after the showing of the messagebox is executed after the messagebox is closed. but there is a problem in this method... the modality of the messagebox is for the whole application not for the owner only. for example, i have 2 forms in the application, Form1 and Form2. Both of them are loaded. the Form1 shows the messagebox, which means it's the owner and you cannot access it until you close the messagebox. So Form2 must be accessible, but this is not what happen. both of the forms are not accessible. :( there's an overload of the ShowDialog which has an IWin32Window parameter for setting the owner. but it's the same as the one with no parameter. :mad: so as a solution for the modal thing, i just set the owner of the messagebox, then use the Show method and disabled the owner. but there's a problem with this(again?:() the execution of the statements, after showing the messagebox, continues even if the messagebox is stil loaded. so as a summary, here's what i want(if possible...:^)) Option 1 - Use ShowDialog method - Set the modality of the messagebox to the owner only (how???) Option 2 - Use Show method and disabled the owner - freeze the process of the owner until the messagebox close (how???) hope that explains well...:^) thanks for your time! :) microsoc :cool:
Hi, can u tell me from where does ur form 2 gets the call to display? if it's from form1 then u cannot solve it but if form2 is called from some other form u can access it. Please send the details what is ur application about i have tried it. Regards, Pramod
-
Hi, can u tell me from where does ur form 2 gets the call to display? if it's from form1 then u cannot solve it but if form2 is called from some other form u can access it. Please send the details what is ur application about i have tried it. Regards, Pramod
thanks for your reply! :) Actually, it's a windows application but Internet Explorer hosted so the one that loads the forms is the IE. there will be an instance/scenario that you want to open more than one forms at a time, for some transaction purposes to validate some data. Anyway, so for example there would be an error occured or a message asking for confirmation for something in one of the openned forms(that's where the messagebox comes in the picture), then when you don't want to close the messagebox yet and go to the other forms or launch another, you can't do that because the messagebox is modal for the whole application. so that's the purpose of the customized messagebox. hope that's what you want to know. thanks for your time! :) microsoc :cool: