简体   繁体   中英

A process on a single win form window

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM