ComboBox问题 [英] ComboBox Question
问题描述
我在组合框的表单加载时提供了一堆项目。
我想要做的是如果用户选择输入不在项目中的值
list我希望能够抓住它并将其分配给字符串变量。
这可能吗?
I provide a bunch of items at form load for the combo box.
What I want to do is if the user chooses to enter a value not in the item
list I want to be able to grab that and assign it to a string variable.
is this possible?
推荐答案
你好,
" scorpion53061" < SC ************ @ yahoo.com> schrieb:
Hello,
"scorpion53061" <sc************@yahoo.com> schrieb:
我在组合框的表单加载时提供了一堆项目。
我想要做的是如果用户选择输入的值不是
在项目列表中我希望能够抓住它并将其分配给字符串变量。
I provide a bunch of items at form load for the combo box.
What I want to do is if the user chooses to enter a value not
in the item list I want to be able to grab that and assign it
to a string variable.
你可以使用组合框''' 'FindString''和''FindStringExact''方法
检查项目列表中是否包含字符串。
-
Herfried K. Wagner
MVP·VB Classic,VB.NET
http://www.mvps.org/dotnet
drnew.Item(" TYPE")= ComboBox1.Text.ToString
这并没有添加用户放在组合框中的内容。
你觉得怎么样?
" Herfried K. Wagner [MVP]" <喜******* @ m.activevb.de>在消息中写道
新闻:O7 ************** @ TK2MSFTNGP10.phx.gbl ...
drnew.Item("TYPE") = ComboBox1.Text.ToString
This doesnt add what the user put in the combo box.
What do you think would?
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:O7**************@TK2MSFTNGP10.phx.gbl...
你好,>
scorpion53061 < SC ************ @ yahoo.com> schrieb:
Hello,
"scorpion53061" <sc************@yahoo.com> schrieb:
我在组合框的表单加载时提供了一堆项目。
我想要做的是如果用户选择输入的值不是
在项目列表中我希望能够抓住它并将其分配给字符串变量。
I provide a bunch of items at form load for the combo box.
What I want to do is if the user chooses to enter a value not
in the item list I want to be able to grab that and assign it
to a string variable.
你可以使用组合框''''FindString''和''FindStringExact''方法来检查项目列表中是否包含字符串。
- Herfried K. Wagner
MVP·VB Classic, VB.NET
http://www.mvps.org/dotnet
Scorpion
我应该先把它放在留言箱里测试一下
对我而言,它的工作原理是
Scorpion
I should try to put it in a messagebox first to test it
For me it works
drnew.Item(" TYPE")= ComboBox1.Text.ToString
drnew.Item("TYPE") = ComboBox1.Text.ToString
messagebox.show(combobox1.text。 toString)
我希望这对你有所帮助。
C或
messagebox.show(combobox1.text.toString)
I hope this helps you a little bit.
Cor
这篇关于ComboBox问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!