简体   繁体   English

以用户身份从键盘导入 Windows 窗体中的值

[英]Import values at windows form from keyboard as user

I would like to set every time i run my program values for 3 variables(for example xy-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?我想在每次运行我的程序时设置 3 个变量的值(例如来自键盘的 xy-z_。我知道如何在控制台应用程序中执行此操作,但我对 win 表单有点困惑,因为我是第一次使用它. 有人能给我一些帮助吗?

Thank you谢谢

If you want something like writing three variables (it will be strings) to three textboxes, just make form with these components (I hope you are using visual studio), then you can get the text from them with something like: string mystring1 = textbox1.text; string mystring2 = textbox1.text; string mystring3 = textbox1.text;如果您想要将三个变量(它将是字符串)写入三个文本框,只需使用这些组件制作表单(我希望您使用的是 Visual Studio),那么您可以使用以下内容从它们获取文本: string mystring1 = textbox1.text; string mystring2 = textbox1.text; string mystring3 = textbox1.text; string mystring1 = textbox1.text; string mystring2 = textbox1.text; string mystring3 = textbox1.text;

and then you will have access to these three variables然后你就可以访问这三个变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM