Results 1 to 3 of 3

Thread: MDI Forms in modal (dialog mode)

  1. #1

    Thread Starter
    Lively Member Luc L.'s Avatar
    Join Date
    Jan 2005
    Posts
    122

    MDI Forms in modal (dialog mode)

    Ok, I have some forms that are children of my primary form. The thing is, I want to display them as a dialog (modal) so that the primary form can't be edited until the currently active child form is closed.

    Now, I want to keep the MDI forms as MDI forms but also be able to display them in modal mode.

    Unfortunately it seems like VB.net errors when I try to .ShowDialog(me) instead of the regular .Show()

    Code:
    VB Code:
    1. Dim frmGen As New frm_Generator
    2.         frmGen.MdiParent = Me
    3.         frmGen.ShowDialog(Me)

    Any ideas?

    Luc L.

  2. #2
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: MDI Forms in modal (dialog mode)

    I haven't done that exact scenario, but when I do ShowDialog, I don't pass any parameters to it.

    frmGen.ShowDialog()

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: MDI Forms in modal (dialog mode)

    A dialog is a dialog and an MDI child is an MDI child. A child form is contained within the parent, so you can't disable the parent without disabling the child too. The whole idea of using MDI is the M, i.e. multiple. If you aren't using multiple forms then there is no real point using MDI. If you don't want the user to be able to access the controls on the parent form while a particular MDI child is open then you would need to disable those controls specifically but, as i said, that goes against the standard Windows interface design, so I wouldn't recommend it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width