显示文本框的名称 [英] Display name of textbox

查看:96
本文介绍了显示文本框的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



如何让动态创建的文本框的值一个接一个地显示。



i有动态文本框,如



文本按钮

文本按钮

文本按钮

文本按钮



当我单击相应文本框旁边的按钮时,它会增加。没问题。

注意以上所有控件文本和按钮都是根据列表框中的项目数动态创建的。



现在我手动放置一个按钮。我需要将相应文本框中的当前值添加到新的列表框中(创建manully)。



怎么办?请帮忙。非常需要这个

解决方案

没有看到你如何创建控制它的困难,但这里是我可能会做的概述......



当我创建texbox和按钮时,将Button的Tag属性设置为TextBox



现在点击按钮我可以访问文本框



  string  myString =(文本框)(button.Tag)。文本; 


Hi all.

How to get the values of the dynamically created textbox to be displayed one below another.

i have the dynamic text boxes like

text button
text button
text button
text button

when i click the button next to the respective textbox its getting incremented. No issues in that.
Note all above controls text and button are created dynamically based on the number of items in listbox.

Now am placing a button manually. i need to get the current values in respective textbox to new listbox (created manully).

how to do so? Please help. badly needed this

解决方案

Without seeing how you are creating teh controls its difficult but here''s an overview of what I might do...

When I create the texbox and button, set the Button''s Tag property to the TextBox

Now when I click the button I can access the textbox with

string myString = (TextBox)(button.Tag).Text;


这篇关于显示文本框的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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