0

We have a simple Windows Forms application that will run in a Windows tablet. What we have so far is running well; the issue I'll be having is moving from winform to winform, and opening/closing Forms.

Currently, it looks something like this.

The following opens the main Form FormHome:

static void Main()
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new FormHome());
}

A click in button from FormHome will then open a new Form call FormInput:

var form = new FormInput();
form.StartPosition = FormStartPosition.CenterParent;
form.ShowDialog();

A click in FormInput will open yet another Form, FormFeedback:

var form = new FormFeedback(patientInputId);
form.StartPosition = FormStartPosition.CenterParent;
form.ShowDialog();

And finally, FormFeedback will open one last final Form, FormThanks:

var form = new FormThanks();
form.StartPosition = FormStartPosition.CenterParent;
form.ShowDialog();

FormThanks doesn't do anything; it just thanks the user and has a Close button. This means that this Close button will close FormThanks, FormFeedback, FormInput, so that the only Form I'll be seeing is FormHome.

Except for closing the winforms, everything else is working fine. But when I see the Forms that need to be opened/closed, I'm thinking that maybe it's better to use another architecture instead of the regular Windows Forms.

I was reading this SO link and someone suggests to use an MDI containter and replace with panels instead. But my first thought is that I'll be seeing the FormBorder of the MDI container, plus the FormBorder of the child Form.

What are your thoughts? Should I switch to another architecture or just find a way to close all those Forms?

Thanks.

Community
  • 1
  • 1
fdkgfosfskjdlsjdlkfsf
  • 3,165
  • 2
  • 43
  • 110

1 Answers1

0

You could try the .hide property. This will hide the forms you don't want to see and then you can use the .show to bring the ones you want forward. I hope i'm helping