简体   繁体   English

Visual Studio C#2010向程序添加/编辑新的其他表单

[英]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.

相关问题 XSL编辑/开发的自定义控件C#Visual Studio 2010 - Custom Control for XSL editing/development C# Visual Studio 2010 在 Visual Studio C# 2010 的父目录中添加项目 - Adding an item that is in a parent directory in Visual Studio C# 2010 使用c#将Access数据库添加到Visual Studio 2010中的项目中 - Adding Access Database to Project in Visual Studio 2010 using c# 在Visual Studio 2010 C#应用程序中添加脚本文件 - Adding a script file in a Visual Studio 2010 C# application 在Visual Studio 2010 C#中使用新的CultureInfo货币 - Using a new cultureinfo currency in Visual Studio 2010 C# Visual Studio 2010 C#调试器不会在新的断点上停止 - Visual Studio 2010 C# Debugger Does not Stop on New Breakpoints 使用C#Windows窗体在Visual Studio中创建新页面 - Creating new pages in Visual Studio using C# Windows Forms 使用 c#、visual studio 和 msbuild 编辑解决方案 - editing a solution with c#, visual studio and msbuild 使用Visual Studio 2010在Firefox中使用C#自动化网站/ Web表单? - Automating Website/Web forms using C# in Firefox, using Visual Studio 2010? 通过表单C#Visual Studio 2010保持选中的单选按钮 - Keep checked radio button checked through forms C# Visual Studio 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM