从用户导入Windows窗体的值 [英] Import values at windows form from users

查看:67
本文介绍了从用户导入Windows窗体的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置每次运行3个变量的程序值(例如键盘中的xy-z_。我知道如何在控制台应用程序中执行此操作,但我对win表单有点困惑,因为我使用它第一次。有人可以给我一些帮助吗?













谢谢



我的尝试:



我没有找到任何帮助。

I would like to set every time i run my program values for 3 variables(for example x-y-z_ from keyboard.I know how to do it at console application but i am a little confused with win form because i use it for a first time.Could someone give me some help?






Thank you

What I have tried:

I haven't find anything helpful.

推荐答案

好吧,如果你从未设置过Windows窗体这是第一次,我确信有更好的教程,因为除非你找到一个,这可能也是希腊语(对我的希腊朋友没有冒犯)



在本质上,如果你可以在你面前的设计视图/模式下获得表格,那么你需要将工具托盘中的标签拖到工具托盘上表单

b)将标签更改为(例如)'X'

c)将文本框拖到表单t上o标签的右侧

d)将文本框名称更改为(例如)value_x



e)重复a-d代表'Y'& 'Z'和value_y,value_z,根据需要对齐标签/文本框

f)将工具面板上的按钮拖到文本框上

g)将事件添加到按钮 - 让我们在button1_click处理程序中调用它button1_click

h),你读取文本框的值,即



Well, if you've never set up a Windows Form for the first time, I'm sure there are better tutorials out there, because unless you do find one, this may as well be Greek (no offence to my Greek friends)

In Essence, if you can get the form in 'design' view/mode in front of you, you

a) drag a label from the tools pallette onto the form
b) change the label to (for example) 'X'
c) drag a textbox onto the form to the right of the label
d) change the textbox name to (for example) value_x

e) repeat a-d for 'Y' & 'Z' and value_y, value_z, aligning the labels/textboxes as you see fit
f) drag a button from the tools palette onto the textbox
g) add an event to the button - lets call it button1_click
h) in the button1_click handler, you read the value of the textboxes, ie

string xText = value_x.Text;
string yText = value_y.Text;
string zText = value_z.Text;





i。 ..)将xText ...值转换为整数等并使用它们



如我所说,你需要找一些教程..这些链接'可能'有帮助



第1步:创建Windows窗体应用程序项目 [ ^ ] < br $> b $ b

使用Visual C#的Windows窗体入门Holowczak.com [ ^ ]


这篇关于从用户导入Windows窗体的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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