How to make a form modeless...???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vince

    How to make a form modeless...???

    I have a windows app whose main dialog contains a button
    that launches a form. I've tried using Form.Show() to
    have it launch as a modeless form, but it behaves as if
    it's modal (i.e. parent form can't receive focus)...

    Can someone tell me what I need to do to make the child
    form modeless..??? I want to be able to alternate focus
    between both dialogs...

    thanks,

    vince


  • vince

    #2
    Re: How to make a form modeless...???

    Rob,

    thanks for the reply...

    I created a test app as you suggested, and it did what it
    was supposed to, allowing me to alternate focus from the
    parent to the child form...

    However, there's nothing unusual about the app in
    question, the main form is a treeview/listview pair with
    a "settings" button that launches the child form using
    Form.Show()...

    The child form contains various controls (textboxes,
    buttons, a monthcalendar control, and a statusbar), and
    the only custom constructor (if you can call it that)
    accepts a string value that is used to initialize a
    textbox in the form...

    I'm still clueless about what could be preventing the
    child form from being modeless...

    thanks for any more suggestions,

    vince

    [color=blue]
    >-----Original Message-----
    >You must have some other code in there causing this,[/color]
    because Show() creates[color=blue]
    >a modeless window.
    >We'll need more information in order to help you. (PS:[/color]
    don't email me the[color=blue]
    >info, type it here in the group so everyone can benefit[/color]
    from the discussion.[color=blue]
    >I don't reply on this email account) Try create a new[/color]
    blank windows form[color=blue]
    >application with Form1 and Form2.
    >Place a button on Form1 that creates a new instance of[/color]
    Form2 and calls the[color=blue]
    >Show method, and you'll see that it's not modal.
    >
    >-Rob [MVP]
    >
    >"vince" <vlusardi@sdcer a.org> wrote in message
    >news:068301c35 7ae$9911ea40$a1 01280a@phx.gbl. ..[color=green]
    >> I have a windows app whose main dialog contains a[/color][/color]
    button[color=blue][color=green]
    >> that launches a form. I've tried using Form.Show() to
    >> have it launch as a modeless form, but it behaves as if
    >> it's modal (i.e. parent form can't receive focus)...
    >>
    >> Can someone tell me what I need to do to make the child
    >> form modeless..??? I want to be able to alternate focus
    >> between both dialogs...
    >>
    >> thanks,
    >>
    >> vince
    >>
    >>[/color]
    >
    >
    >.
    >[/color]

    Comment

    • Rob Teixeira [MVP]

      #3
      Re: How to make a form modeless...???

      You must have some other code in there causing this, because Show() creates
      a modeless window.
      We'll need more information in order to help you. (PS: don't email me the
      info, type it here in the group so everyone can benefit from the discussion.
      I don't reply on this email account) Try create a new blank windows form
      application with Form1 and Form2.
      Place a button on Form1 that creates a new instance of Form2 and calls the
      Show method, and you'll see that it's not modal.

      -Rob [MVP]

      "vince" <vlusardi@sdcer a.org> wrote in message
      news:068301c357 ae$9911ea40$a10 1280a@phx.gbl.. .[color=blue]
      > I have a windows app whose main dialog contains a button
      > that launches a form. I've tried using Form.Show() to
      > have it launch as a modeless form, but it behaves as if
      > it's modal (i.e. parent form can't receive focus)...
      >
      > Can someone tell me what I need to do to make the child
      > form modeless..??? I want to be able to alternate focus
      > between both dialogs...
      >
      > thanks,
      >
      > vince
      >
      >[/color]


      Comment

      • vince lusardi

        #4
        Re: How to make a form modeless...???

        Rob,

        thanks for the reply...

        I did create a test app with 2 simple forms and I got the child to
        behave as a modeless form...

        However, there's really nothing unusual about the app in question, main
        form is a treeview/listview pair with a "settings" button that launches
        the child form using the Form.Show() method...

        Child form contains various controls (textboxes, buttons, a
        monthcalendar control and a statusbar)... there are no special property
        settings for it, and the only custom constructor (if you can call it
        that) accepts a string that is used to initialize one of the
        textboxes...

        Once the child form is launched, the parent form can't receive focus
        until the child form is closed...

        Any other suggestions would be appreciated...

        vince



        Vince Lusardi
        vlusardi@sdcera .org

        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        • vince

          #5
          Re: How to make a form modeless...???

          Rob,

          thanks for the reply...

          I created a test app as you suggested, and it did what it
          was supposed to, allowing me to alternate focus from the
          parent to the child form...

          However, there's nothing unusual about the app in
          question, the main form is a treeview/listview pair with
          a "settings" button that launches the child form using
          Form.Show()...

          The child form contains various controls (textboxes,
          buttons, a monthcalendar control, and a statusbar), and
          the only custom constructor (if you can call it that)
          accepts a string value that is used to initialize a
          textbox in the form...

          I'm still clueless about what could be preventing the
          child form from being modeless...

          thanks for any more suggestions,

          vince

          [color=blue]
          >-----Original Message-----
          >You must have some other code in there causing this,[/color]
          because Show() creates[color=blue]
          >a modeless window.
          >We'll need more information in order to help you. (PS:[/color]
          don't email me the[color=blue]
          >info, type it here in the group so everyone can benefit[/color]
          from the discussion.[color=blue]
          >I don't reply on this email account) Try create a new[/color]
          blank windows form[color=blue]
          >application with Form1 and Form2.
          >Place a button on Form1 that creates a new instance of[/color]
          Form2 and calls the[color=blue]
          >Show method, and you'll see that it's not modal.
          >
          >-Rob [MVP]
          >
          >"vince" <vlusardi@sdcer a.org> wrote in message
          >news:068301c35 7ae$9911ea40$a1 01280a@phx.gbl. ..[color=green]
          >> I have a windows app whose main dialog contains a[/color][/color]
          button[color=blue][color=green]
          >> that launches a form. I've tried using Form.Show() to
          >> have it launch as a modeless form, but it behaves as if
          >> it's modal (i.e. parent form can't receive focus)...
          >>
          >> Can someone tell me what I need to do to make the child
          >> form modeless..??? I want to be able to alternate focus
          >> between both dialogs...
          >>
          >> thanks,
          >>
          >> vince
          >>
          >>[/color]
          >
          >
          >.
          >[/color]

          Comment

          • Bob Grommes

            #6
            Re: How to make a form modeless...???

            I believe you want ShowDialog() to make it modal.

            --Bob

            "vince" <vlusardi@sdcer a.org> wrote in message
            news:068301c357 ae$9911ea40$a10 1280a@phx.gbl.. .[color=blue]
            > I have a windows app whose main dialog contains a button
            > that launches a form. I've tried using Form.Show() to
            > have it launch as a modeless form, but it behaves as if
            > it's modal (i.e. parent form can't receive focus)...
            >
            > Can someone tell me what I need to do to make the child
            > form modeless..??? I want to be able to alternate focus
            > between both dialogs...
            >
            > thanks,
            >
            > vince
            >
            >[/color]


            Comment

            • Bob Grommes

              #7
              Re: How to make a form modeless...???

              I believe you want ShowDialog() to make it modal.

              --Bob

              "vince" <vlusardi@sdcer a.org> wrote in message
              news:068301c357 ae$9911ea40$a10 1280a@phx.gbl.. .[color=blue]
              > I have a windows app whose main dialog contains a button
              > that launches a form. I've tried using Form.Show() to
              > have it launch as a modeless form, but it behaves as if
              > it's modal (i.e. parent form can't receive focus)...
              >
              > Can someone tell me what I need to do to make the child
              > form modeless..??? I want to be able to alternate focus
              > between both dialogs...
              >
              > thanks,
              >
              > vince
              >
              >[/color]


              Comment

              • vince

                #8
                Re: How to make a form modeless...???

                Bob,

                I want to do the exact opposite of ShowDialog, make the
                child MODELESS, so that I can alternate focus between the
                child and the parent... I've tried Form.Show(), which
                should work, but it doesn't and I'm trying to figure out
                why... read thru the thread again for more details...

                thanks for any help...

                vince
                [color=blue]
                >-----Original Message-----
                >I believe you want ShowDialog() to make it modal.
                >
                >--Bob
                >
                >"vince" <vlusardi@sdcer a.org> wrote in message
                >news:068301c35 7ae$9911ea40$a1 01280a@phx.gbl. ..[color=green]
                >> I have a windows app whose main dialog contains a[/color][/color]
                button[color=blue][color=green]
                >> that launches a form. I've tried using Form.Show() to
                >> have it launch as a modeless form, but it behaves as if
                >> it's modal (i.e. parent form can't receive focus)...
                >>
                >> Can someone tell me what I need to do to make the child
                >> form modeless..??? I want to be able to alternate focus
                >> between both dialogs...
                >>
                >> thanks,
                >>
                >> vince
                >>
                >>[/color]
                >
                >
                >.
                >[/color]

                Comment

                • vince

                  #9
                  Re: How to make a form modeless...???

                  Bob,

                  I want to do the exact opposite of ShowDialog, make the
                  child MODELESS, so that I can alternate focus between the
                  child and the parent... I've tried Form.Show(), which
                  should work, but it doesn't and I'm trying to figure out
                  why... read thru the thread again for more details...

                  thanks for any help...

                  vince
                  [color=blue]
                  >-----Original Message-----
                  >I believe you want ShowDialog() to make it modal.
                  >
                  >--Bob
                  >
                  >"vince" <vlusardi@sdcer a.org> wrote in message
                  >news:068301c35 7ae$9911ea40$a1 01280a@phx.gbl. ..[color=green]
                  >> I have a windows app whose main dialog contains a[/color][/color]
                  button[color=blue][color=green]
                  >> that launches a form. I've tried using Form.Show() to
                  >> have it launch as a modeless form, but it behaves as if
                  >> it's modal (i.e. parent form can't receive focus)...
                  >>
                  >> Can someone tell me what I need to do to make the child
                  >> form modeless..??? I want to be able to alternate focus
                  >> between both dialogs...
                  >>
                  >> thanks,
                  >>
                  >> vince
                  >>
                  >>[/color]
                  >
                  >
                  >.
                  >[/color]

                  Comment

                  Working...