Modal form

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

    #1

    Modal form

    In Access there was a modal property of a form... it required that the
    current form be "answered" before getting to another form within the
    program. Is there such a property in VB.net ? If not, how might you
    accomplish this ?

    Thanks!


  • G Himangi

    #2
    Re: Modal form

    Use Form.ShowDialog to display a modal form.

    ---------
    - G Himangi, Sky Software http://www.ssware.com
    Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
    Browsing Functionality For Your App (.Net & ActiveX Editions).
    EZNamespaceExte nsions.Net : Develop namespace extensions rapidly in .Net
    EZShellExtensio ns.Net : Develop all shell extensions,expl orer bars and BHOs
    rapidly in .Net
    ---------


    "Rob" <robc1@yahoo.co mwrote in message
    news:G4GdnZ4Gnv 51wsvbnZ2dnUVZ_ hKdnZ2d@comcast .com...
    In Access there was a modal property of a form... it required that the
    current form be "answered" before getting to another form within the
    program. Is there such a property in VB.net ? If not, how might you
    accomplish this ?
    >
    Thanks!
    >

    Comment

    • Ray Cassick

      #3
      Re: Modal form

      Two things..

      1) You can look at the form border type property to control what buttons and
      options are availabel on that form when shown. One of them is fixed dialog.

      2) When you show the form use the ShoeDialog method:

      Dim frm As New FormToShow
      frm.ShowDialog

      You can even get a dialog result from the from as it closes just like a real
      standard dialog box by setting the forms DialogResult values.

      Dim frm As New FormToShow
      Dim retval as DialogResult

      retval = frmShowDialog

      If retval = DialogResult.OK

      Else

      End If

      In this example the frm would have a setting as such:

      Me.DialogResult = Windows.Forms.D ialogResult.OK


      "Rob" <robc1@yahoo.co mwrote in message
      news:G4GdnZ4Gnv 51wsvbnZ2dnUVZ_ hKdnZ2d@comcast .com...
      In Access there was a modal property of a form... it required that the
      current form be "answered" before getting to another form within the
      program. Is there such a property in VB.net ? If not, how might you
      accomplish this ?
      >
      Thanks!
      >

      Comment

      • gadgeteer

        #4
        Re: Modal form

        What if the form that needs to be modal is not a Top-level form. For example
        it is embedded as a docked control in a panel on another form?


        "Ray Cassick" <rcassick@enter procity.comwrot e in message
        news:OO8uxPonHH A.4960@TK2MSFTN GP02.phx.gbl...
        Two things..
        >
        1) You can look at the form border type property to control what buttons
        and options are availabel on that form when shown. One of them is fixed
        dialog.
        >
        2) When you show the form use the ShoeDialog method:
        >
        Dim frm As New FormToShow
        frm.ShowDialog
        >
        You can even get a dialog result from the from as it closes just like a
        real standard dialog box by setting the forms DialogResult values.
        >
        Dim frm As New FormToShow
        Dim retval as DialogResult
        >
        retval = frmShowDialog
        >
        If retval = DialogResult.OK
        >
        Else
        >
        End If
        >
        In this example the frm would have a setting as such:
        >
        Me.DialogResult = Windows.Forms.D ialogResult.OK
        >
        >
        "Rob" <robc1@yahoo.co mwrote in message
        news:G4GdnZ4Gnv 51wsvbnZ2dnUVZ_ hKdnZ2d@comcast .com...
        >In Access there was a modal property of a form... it required that the
        >current form be "answered" before getting to another form within the
        >program. Is there such a property in VB.net ? If not, how might you
        >accomplish this ?
        >>
        >Thanks!
        >>
        >
        >

        Comment

        • rowe_newsgroups

          #5
          Re: Modal form

          On May 25, 9:29 pm, "gadgeteer" <nos...@spam.co mwrote:
          What if the form that needs to be modal is not a Top-level form. For example
          it is embedded as a docked control in a panel on another form?
          >
          "Ray Cassick" <rcass...@enter procity.comwrot e in message
          >
          news:OO8uxPonHH A.4960@TK2MSFTN GP02.phx.gbl...
          >
          Two things..
          >
          1) You can look at the form border type property to control what buttons
          and options are availabel on that form when shown. One of them is fixed
          dialog.
          >
          2) When you show the form use the ShoeDialog method:
          >
          Dim frm As New FormToShow
          frm.ShowDialog
          >
          You can even get a dialog result from the from as it closes just like a
          real standard dialog box by setting the forms DialogResult values.
          >
          Dim frm As New FormToShow
          Dim retval as DialogResult
          >
          retval = frmShowDialog
          >
          If retval = DialogResult.OK
          >
          Else
          >
          End If
          >
          In this example the frm would have a setting as such:
          >
          Me.DialogResult = Windows.Forms.D ialogResult.OK
          >
          "Rob" <r...@yahoo.com wrote in message
          news:G4GdnZ4Gnv 51wsvbnZ2dnUVZ_ hKdnZ2d@comcast .com...
          In Access there was a modal property of a form... it required that the
          current form be "answered" before getting to another form within the
          program. Is there such a property in VB.net ? If not, how might you
          accomplish this ?
          >
          Thanks!
          I didn't know you could dock a form in a panel?

          Thanks,

          Seth Rowe

          Comment

          • Stephany Young

            #6
            Re: Modal form

            Of course you can!!!!!!

            form.Parent = control

            I think the question should have been:

            Why on earth would one want to use a docked form as a modal dialog?


            "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
            news:1180143410 .291630.132830@ p47g2000hsd.goo glegroups.com.. .
            On May 25, 9:29 pm, "gadgeteer" <nos...@spam.co mwrote:
            >What if the form that needs to be modal is not a Top-level form. For
            >example
            >it is embedded as a docked control in a panel on another form?
            >>
            >"Ray Cassick" <rcass...@enter procity.comwrot e in message
            >>
            >news:OO8uxPonH HA.4960@TK2MSFT NGP02.phx.gbl.. .
            >>
            Two things..
            >>
            1) You can look at the form border type property to control what
            buttons
            and options are availabel on that form when shown. One of them is fixed
            dialog.
            >>
            2) When you show the form use the ShoeDialog method:
            >>
            Dim frm As New FormToShow
            frm.ShowDialog
            >>
            You can even get a dialog result from the from as it closes just like a
            real standard dialog box by setting the forms DialogResult values.
            >>
            Dim frm As New FormToShow
            Dim retval as DialogResult
            >>
            retval = frmShowDialog
            >>
            If retval = DialogResult.OK
            >>
            Else
            >>
            End If
            >>
            In this example the frm would have a setting as such:
            >>
            Me.DialogResult = Windows.Forms.D ialogResult.OK
            >>
            "Rob" <r...@yahoo.com wrote in message
            >news:G4GdnZ4Gn v51wsvbnZ2dnUVZ _hKdnZ2d@comcas t.com...
            >In Access there was a modal property of a form... it required that the
            >current form be "answered" before getting to another form within the
            >program. Is there such a property in VB.net ? If not, how might
            >you
            >accomplish this ?
            >>
            >Thanks!
            >
            I didn't know you could dock a form in a panel?
            >
            Thanks,
            >
            Seth Rowe
            >

            Comment

            Working...