Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ShowDialog

ShowDialog

Scheduled Pinned Locked Moved C#
helpquestion
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    microsoc
    wrote on last edited by
    #1

    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! :)

    A 1 Reply Last reply
    0
    • M microsoc

      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! :)

      A Offline
      A Offline
      AB7771
      wrote on last edited by
      #2

      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

      M 1 Reply Last reply
      0
      • A AB7771

        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

        M Offline
        M Offline
        microsoc
        wrote on last edited by
        #3

        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! :)

        A 1 Reply Last reply
        0
        • M microsoc

          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! :)

          A Offline
          A Offline
          AB7771
          wrote on last edited by
          #4

          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

          M 1 Reply Last reply
          0
          • A AB7771

            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

            M Offline
            M Offline
            microsoc
            wrote on last edited by
            #5

            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:

            A 2 Replies Last reply
            0
            • M microsoc

              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:

              A Offline
              A Offline
              AB7771
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • M microsoc

                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:

                A Offline
                A Offline
                AB7771
                wrote on last edited by
                #7

                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

                M 1 Reply Last reply
                0
                • A AB7771

                  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

                  M Offline
                  M Offline
                  microsoc
                  wrote on last edited by
                  #8

                  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:

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups