动态创建文本框的动态文本更改

问题描述:



我正在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!