如何创建Visual C#多窗体 [英] How to create Visual C# multi form

查看:169
本文介绍了如何创建Visual C#多窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建3种形式.
看起来很简单,但是对我来说很难编写代码.

我想使用数组来处理文本框内容
任何帮助将不胜感激.



第一种形式
用户输入到textbox1
textbox2

按钮-> textbox1和textbox2到数组

第二种形式
用户输入到textbox3(多行)
按钮-> textbox3数组

(他们可以在第二个表格的底部显示总的实际输入数据吗?)


第三种形式
显示6个项目
textbox1(来自第一个Form1)
textbox2(来自第一个Form1)
总行(从第二个表格开始)
编辑第二张表格
保存到文件
quit

I want to create 3 forms.
Looks simple, but it is hard for me to crate coding.

I want to use array to handle textbox content
Any help will be apprciated.



1st form
user input to textbox1
textbox2

button -> textbox1 and textbox2 to array

2nd form
User input to textbox3 (multi line)
button -> textbox3 to array

(Can they show real input data total at the bottom of 2nd form ? )


3rd form
Display 6 items
textbox1 (from 1st Form1)
textbox2 (from 1st Form1)
total line (from 2nd Form)
edit 2nd form
save to file
quit

推荐答案

打开Visual Studio.创建一个新的Windows窗体应用程序.右键单击解决方案资源管理器中右侧的项目,然后创建一个新的Windows窗体.给它起个名字吧.当它打开时,您会在左侧看到一个工具箱.双击任何项目(按钮,文本框等),使其显示在表单上.右键单击一个项目,然后选择属性"以查看该控件的名称.您可以从后面的代码中使用该名称访问该控件.您还可以为不同控件上的各种事件(例如按钮单击事件)创建事件处理程序.基本上就是您制作新表格的方式.

如果您在尝试了其中的一些内容并阅读了教程(也许是一本书或两本书)后仍有任何特定的问题,请在此处将它们作为新问题发布在快速解答"中.
Open Visual Studio. Create a new Windows Forms application. Right click on the project on the right in the solution explorer and create a new Windows Form. Give it some name. When it opens, you''ll notice a toolbox to the left. Double click any item (buttons, textboxes, etc.) to make it appear on the form. Right click on an item and select "properties" to see the name of that control. You can access the control by that name from the code-behind. You can also create event handlers for various events on different controls (e.g., button click events). That''s basically how you make a new form.

If you have any specific questions after trying some of this out and reading tutorials and maybe a book or two, then post them here in Quick Answers as a new question.


这篇关于如何创建Visual C#多窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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