动态创建文本框的动态文本更改 [英] Dynamically textchang of Dynamically created textbox

查看:90
本文介绍了动态创建文本框的动态文本更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在Visual Studio 2010中开发C#窗口应用程序
我在页面加载事件中动态创建2个文本框.
我希望当我在一个文本框中输入值时,该值的两倍会自动显示在另一个文本框中.

我在第一个文本框中使用textchange事件处理程序.但是我很困惑如何在另一个文本框中显示值.

谁能帮我吗?

Hi,

I m developing c# window application in visual studio 2010
I m creating 2 textboxes dynamically on page load event.
I want that, when i enter value in one textbox, double of that value is automatcally display in another textbox.

i m using textchange eventhandler for First textbox.But i m cofused how i show value in another textbox.

Can anyone help me please?

Thanks In Advance!

推荐答案

其中有什么令人困惑的地方?

1.动态创建tetbox1和textbox2
2.将文本更改事件处理程序附加到textbox1
3.现在,每当更改textbox1文本时,都会引发附加的textchange事件处理程序.
4.在此更改事件中,获取textbox1的文本并使用/更改它以根据需要在textbox2中显示

试试吧!
What''s confusing in it?

1. Create tetbox1 & textbox2 dynamically
2. Attach text change event handler to textbox1
3. Now, whenever textbox1 text will get changed, textchange event handler attached would get raised.
4. In this change event, get the text of the textbox1 and use/change it to show as per need in textbox2

Try!


这篇关于动态创建文本框的动态文本更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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