在文本框中找到文本 [英] find the text in textbox

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

问题描述

先生,

我正在使用datagrid来显示数据,在我的datagrid中包含用于选择名称的复选框.如果我选中复选框,则选定的行cell(1)值将显示在文本框中.

我的问题是,如果我选择多次,则将值插入多次,但是我的要求是在文本框中仅插入一次值.

我正在使用列表框,我使用
处理了此问题
ListBox1.Items.FindByText(String)

以相同的方式处理文本框中的上述问题.文本框包含任何FindBYText方法吗?

请给我一个解决方法先生.

谢谢

hi sir,

i am using datagrid to display data, in my datagrid contains checkboxes for selecting names. if i select checkboxes that selected row cell(1) value is displayed in textbox.

my problem is if i select multiple times, value is inserted into multiple times but my requirement is one value is inserted only one time in Textbox.

i am using listbox i handle this problem using

ListBox1.Items.FindByText(String)

at the same way how to handle the above problem in Textbox. Textbox contain any FindBYText method?

Please give a solution sir.

Thanks

推荐答案

您需要这样的东西吗?

Would you need something like this?

Private Function FindTextBoxText(byval S as String)
Dim tb As TextBox
Dim ctrl As Control
For Each ctrl In Controls
If TypeOf ctrl Is TextBox Then
tb = ctrl
if String.Compare(tb.Text, s, StringComparison.CurrentCultureIgnoreCase) = 0 Then
Return tb
End If
Next
return Nothing
End Sub



祝你好运!



Good luck!


如果我比你还写了一些代码来填充文本框,则为网格行的值.

如果是,那是什么问题,只需在填充前将文本框为空即可.

希望对您有帮助.
If i right than u have written code some where for fill the textbox, value of grid row.

If yes then what is the problem, just make textbox empty before the fill.

Hope this will help u.


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

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