none
Forms Dialog

    Question

  • Hi,

    I am new to windows forms, so this is maybe a very easy question.

    I try to build a little program. I just want to do it like a standard windows program with a menu and windows opening within the program.

    If I use the forms.showdialog method it just opens another window, but I would like to open it in another window.

    Maybe there is a simple tutorial about this? I searched about a few hours but I can not find something helpful.

    Thanks.

    Dragonal

    Tuesday, August 14, 2012 1:57 PM

Answers

  • Sounds like you might be trying to create a MDI.  i.e. within the main window of the application you would like to open additional windows.

    You could put a panel control within the main window and then any new window you wanted to show within that panel could be done by something like

    panel.Controls.Add(theForm)
    theForm.Show()


    May we all make money in the sequel.

    • Marked as answer by Dragonalw Thursday, August 16, 2012 9:34 AM
    Wednesday, August 15, 2012 5:31 PM

All replies

  • If you're trying to open another window without being a dialog, just use theForm.Show() instead of ShowDialog():

    YourForm form = new YourForm();
    form.Show();
    


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, August 14, 2012 3:33 PM
  • Sounds like you might be trying to create a MDI.  i.e. within the main window of the application you would like to open additional windows.

    You could put a panel control within the main window and then any new window you wanted to show within that panel could be done by something like

    panel.Controls.Add(theForm)
    theForm.Show()


    May we all make money in the sequel.

    • Marked as answer by Dragonalw Thursday, August 16, 2012 9:34 AM
    Wednesday, August 15, 2012 5:31 PM
  • I should mention the obvious too.  There is the MDIParent type form which can be selected when adding a new form to the project.


    May we all make money in the sequel.

    Wednesday, August 15, 2012 5:39 PM
  • Hello Dragonal,

    Your question is little confusing. You want to display a Windows Form on firing an event or You want to display a Dialogue Box on firing an event. Please make your question clear so that it would be more easier for us also.

    Above answers have described both condition in well.

    Thursday, August 16, 2012 3:31 AM
  • Hi,

    MDI and MDIParent type was the thing I was looking for.

    Thanks.

    Thursday, August 16, 2012 8:34 AM