使用文本框数据作为整个应用程序的变量. [英] using a textbox data as a variable for whole applications.

查看:76
本文介绍了使用文本框数据作为整个应用程序的变量.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程新手,需要帮助.我正在使用Visual Basic和Win Forms用户控件.

我有一个用户控件,该控件具有文本框,我希望在其中输入用户正在尝试获取数据的计算机的计算机名称.在此应用程序中,我还有其他6个用户控件,它们需要该文本框中的计算机名称.我如何声明该变量.

我可以在用户控件中创建变量,并且该变量可以正常工作.

暗淡的strcomputer作为字符串
strcomputer =机器名.text

文本框名称是计算机名.感谢您提前提供的帮助,并且越详细越好,因此我以后可以进行此操作.

I am new to programming and need help. I m working with visual basic and win forms user controls.

I have one usercontrol that has the textbox where i would like to have a user type in the machine name of a computer they are trying to get data on. in this application i have 6 other user controls that will need the machine name from that one textbox. How do i declare that variable.

I can create the variable in the usercontrol and it works.

dim strcomputer as string
strcomputer = machinename.text

the textbox name is machinename. Thanks for the help ahead of time, and the more detailed the better so i can do this later on.

推荐答案

我假设您要放入将machinename.text插入另一个文本框控件?

如果是这样,

I am assuming that you want to put the contents of machinename.text into another textbox control?

If so then

anothertextboxName.text = machinename.text


我不确定您要做什么,但我认为您是在谈论 ^ ].
I''m not sure what you want to do, but i think you are talking about scoping of variables[^].


这篇关于使用文本框数据作为整个应用程序的变量.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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