[英]Visual Studio C# 2010 adding/editing new additional forms to a program
So I am new to actually building GUI and I am creating a project where when you click on one button you open a new form. 因此,我不熟悉实际构建GUI的过程,还创建了一个项目,当您单击一个按钮时,您会打开一个新表单。 With this new form I want to be able to add and edit things to it. 有了这个新表格,我希望能够为其添加和编辑内容。
In my solution explorer it is only showing the first form that I originally create, not the second one. 在我的解决方案资源管理器中,它仅显示我最初创建的第一个表单,而不显示第二个表单。 I went online and used one of those little microsoft blurbs about creating a new form when a button is clicked, and I am a little lost from there. 我上网,并使用了一些微软的小技巧来创建一个新的表单,当单击一个按钮时,我从那里有点迷失了。
My program is going to have multiple buttons that you click and they open certain forms. 我的程序将具有多个单击的按钮,它们将打开某些表单。 I understand that I have the button_click set to create a new form. 我了解我已将button_click设置为创建新表单。 I now want to know how to edit these forms that are created. 我现在想知道如何编辑创建的这些表单。
I tried refreshing my solution explorer and it wouldn't show my newly created design. 我尝试刷新解决方案资源管理器,但不会显示我新创建的设计。 (I thought that could be one of my possible errors, haha) Could someone please let me know what I should be doing? (我认为这可能是我可能的错误之一,哈哈)有人可以让我知道我应该怎么做吗?
First add a new form. 首先添加一个新表格。 Right click on your project (my project is called Test
) and give it a name (I called it TestForm
): 右键单击您的项目(我的项目称为Test
),并为其命名(我称为TestForm
):
Then, add the following code to your button: 然后,将以下代码添加到您的按钮:
TestForm MyForm = new TestForm();
MyForm.Show();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.