Visual Studio C#2010为程序添加/编辑新的附加表单 [英] Visual Studio C# 2010 adding/editing new additional forms to a program

查看:211
本文介绍了Visual Studio C#2010为程序添加/编辑新的附加表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我是新的实际构建GUI,我正在创建一个项目,当你点击一个按钮,你打开一个新窗体。有了这个新的表单,我想能够添加和编辑它的东西。

在我的解决方案资源管理器中,它只显示我最初创建的第一个表单,而不是第二个表单。我上网并使用其中一个微软模糊技术来创建一个新表单,当点击一个按钮时,我有点迷路了。



我的程序正在运行有多个按钮,您可以点击并打开某些表单。我知道我已经设置了button_click来创建一个新表单。我现在想知道如何编辑这些创建的表单。

我尝试刷新我的解决方案资源管理器,它不会显示我新创建的设计。 (我认为这可能是我可能犯的错误之一,哈哈)有人请让我知道我应该做什么?

解决方案

首先添加一个新表单。右键点击你的项目(我的项目名为 Test )并给它一个名称(我称之为 TestForm ):



然后,将下面的代码添加到您的按钮中:

  TestForm MyForm = new TestForm(); 
MyForm.Show();


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. 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. 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):

Then, add the following code to your button:

TestForm MyForm = new TestForm();
MyForm.Show();

这篇关于Visual Studio C#2010为程序添加/编辑新的附加表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆