以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 如何取得复选组合框中的多个值? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=22829) |
-- 作者:zpx_2012 -- 发布时间:2012/8/24 19:03:00 -- 如何取得复选组合框中的多个值? 各位老师,复选组合框中有一个或多个值,想要取出来用,是不是用下面的代码
Dim ccb As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1") Dim nms() As String = ("ccb.value".split(",")) For Each nm As String In nms output.show(nm) next
执行后什么也没有?请问上面第二句代码要怎么写?
谢谢!
|
-- 作者:czy -- 发布时间:2012/8/24 19:23:00 -- Dim nms() As String = e.Form.Controls("CheckedComboBox1").Value.split(",") For Each nm As String In nms output.show(nm) Next |
-- 作者:zpx_2012 -- 发布时间:2012/8/24 20:00:00 -- 谢谢czy!是不是代码中只能用 Dim c As String = e.Form.Controls("CheckedComboBox1").value 而不能先定义 Dim ccb As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1") 然后在中间使用 Dim c As String = ccb.value
但这样中间用到控制的值都是一长串,看起来不是很方便。 |
-- 作者:czy -- 发布时间:2012/8/24 20:27:00 -- 都可以,方法多种多样
Dim ccb As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1")
Dim s As String = e.Form.Controls("CheckedComboBox1").Value
|