如何将一种形式的文本框值转换为另一种形式 [英] how to get the text box value of one form to another form

查看:91
本文介绍了如何将一种形式的文本框值转换为另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我可能知道如何在.net窗口应用程序中将登录文本框的值转换为另一种形式...感谢

hi may i know how to get the login text box value to another form in .net window application...thanks

推荐答案



此链接可能对您有帮助,

在表单之间传递数据 [在Windows窗体之间传递数据 [
Hi,

This links might help you,

Pass data between forms[^]

Passing Data between Windows Forms[^]


有几种方法,具体取决于您的情况.您正在努力实现.如果要将用户名作为字符串从登录表单传递到主表单,则可以在主表单中创建一个构造函数,该构造函数将字符串作为参数,然后将用户名作为参数传递.您还可以在登录表单中创建一个公共属性,该属性返回一个字符串,并从其他表单访问该属性.基本上,最佳选择取决于您要执行的操作.
There are several ways of doing this, depending on your circumstances in what you are trying to achieve. If you want to pass the username as a string from the login form to the main form, you can create a constructor in your main form that takes a string as a parameter, and then pass the username as the parameter. You could also create a public property in your login form that returns a string, and access that from other forms. Basically, the best option will depend on what you are trying to do.


您可以从Visual Studio中可用的登录工具箱"中使用"LoginName" Contron.
另外,您也可以为此状态使用状态管理.
You can use "LoginName" Contron from our Login Toolbox available in Visual Studio.
Alternatively, You can also use State Management for this purpus.


这篇关于如何将一种形式的文本框值转换为另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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