如何在Windows窗体.NET中打开一个新的窗口? [英] How to open a new window in Windows Forms in .NET?

查看:120
本文介绍了如何在Windows窗体.NET中打开一个新的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个除其他事项外有一个编辑按钮和一个应用程序,当用户点击该按钮我想要一个新的窗口,以各种文本框打开进行编辑。

I have an application that among other things has an Edit Button and when the user clicks on that button I want a new window to open with various textboxes for editing purposes.

我可以创建code一个新的窗口像

I can create a new window with code like

Form editform = new Form();

不过,我想设计在设计该窗口了。

But I want to design that window in the Designer too.

推荐答案

在Visual Studio中,您的项目右键单击,然后选择添加 - > Windows窗体。这会给你一种新形式的工作。你想怎么打好它。

In Visual Studio, right-click on your project and select Add->Windows Form. That will give you a new form to work with. Lay it out how you want. Then you can launch the window from your main window with code similar to the following:

MyEditForm form = new MyEditForm();
form.Show();

这篇关于如何在Windows窗体.NET中打开一个新的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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