Can a UserControl invoke a modeless (non-dialog) form when, in a host project, it's on a modal (dialog) parent form? RRS feed

  • Question


    Visual Basic 2015, WinForms


    I've got a UserControl project which include a WinForms element so my control can invoke a form (i.e., a Find/Replace form for a rich-text-editor UserControl). The question is, what if I want the form it invokes to be modeless (non-dialog, so the user can go back to the UserControl while it's showing) but there's a chance the control's own parent form (in a host project) is a modal (dialog) form (sometimes that's unavoidable)? In the primordial days of "Classic VB", it wasn't possible for a modal form to invoke a modeless form. Has .NET overcome that limitation, or should I require that my form-within-a-user-control be invoked dialog-style?

    Robert Gustafson

    Thursday, December 7, 2017 1:20 AM

All replies

  • Did you try it? It would take as much time to create a test project as it does to type the question.

    I don't k now what you are asking. You ask about "should I require that my form-within-a-user-control" but it is not clear why you might need that.

    If I understand what you are asking then it works except the modeless form remains shown when I close the form that showed it. So I assume you would want to explicitly close the modeless form.

    First try it and then if you have questions then you can be more specific.

    Sam Hobbs

    Thursday, December 7, 2017 9:20 PM