Home > other >  A process on a single win form window
A process on a single win form window

Time:01-13

I am developing an application in Windows Form C#, it begins with an explanatory window, language selection and a start button when the desired language is selected, I want that when I press the start button, all the elements disappear and begin the application process, I had thought of creating a new form, but this opens a new window and I don't want that, I want everything to happen on a window. Apart from making all the previous controls invisible, is there any way to achieve this? Or maybe a way to make all the controls invisible without going one by one?

CodePudding user response:

You could put multiple controls in a panel for example and hide/show entire panel. If you dont want to do that, you could always do it in a loop for example:

foreach ( var control in this.Controls)
{
   control.Visible=false;
}

Ofcourse you could also add controls dynamically, but that might be hard for a beginner.

You could also make use of MDI forms, but that might be also not worth it.

CodePudding user response:

SOLVED

Solved using user controls, user controls allow me to design the application interface in the same way as a form and I can add and remove that control from the form as many times as I want, making it possible to display numerous interfaces in a single Windows Forms window.

This solution was suggested by Jeroen van Langen in the comments of my question and it was exactly what I was looking for.

  •  Tags:  
  • Related