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. have a child while parent is not accesible

have a child while parent is not accesible

Scheduled Pinned Locked Moved C#
questiontutorial
7 Posts 3 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.
  • C Offline
    C Offline
    cppwxwidgetsss
    wrote on last edited by
    #1

    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();

    V 1 Reply Last reply
    0
    • C cppwxwidgetsss

      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();

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #2

      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.

      F C 2 Replies Last reply
      0
      • V Vikram A Punathambekar

        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.

        F Offline
        F Offline
        Fired Fish Gmail
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • V Vikram A Punathambekar

          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.

          C Offline
          C Offline
          cppwxwidgetsss
          wrote on last edited by
          #4

          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

          F V 2 Replies Last reply
          0
          • C cppwxwidgetsss

            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

            F Offline
            F Offline
            Fired Fish Gmail
            wrote on last edited by
            #5

            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

            C 1 Reply Last reply
            0
            • F Fired Fish Gmail

              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

              C Offline
              C Offline
              cppwxwidgetsss
              wrote on last edited by
              #6

              thank you merci

              1 Reply Last reply
              0
              • C cppwxwidgetsss

                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

                V Offline
                V Offline
                Vikram A Punathambekar
                wrote on last edited by
                #7

                Hey, glad to help you man :) Yeah, I guess I got my answer mixed up though.

                Cheers, Vıkram.

                Carpe Diem.

                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