简体   繁体   English

单赢形式window上的一个过程

[英]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.我正在 Windows 表格 C# 中开发应用程序,它以说明性 window、语言选择和启动按钮开始我曾想过创建一个新表单,但这会打开一个新的 window,我不希望这样,我希望一切都发生在 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.您也可以使用 MDI forms,但这也可能不值得。

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.使用用户控件解决,用户控件允许我以与表单相同的方式设计应用程序界面,我可以根据需要多次从表单中添加和删除该控件,从而可以在单个 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. Jeroen van Langen 在我的问题的评论中提出了这个解决方案,这正是我想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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