Foxtable(狐表)用户栏目专家坐堂 → [求助]窗口listbox控件 items 集合 问题


  共有3489人关注过本帖树形打印复制链接

主题:[求助]窗口listbox控件 items 集合 问题

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/6/18 19:29:00 [显示全部帖子]

不明白你的意思,如果要用Addrange,就这样

 

Dim lb As WinForm.ListBox = e.Form.Controls("ListBox1")
Dim sz(10) As   String
Dim lst As new List(of String)
lst.AddRange(lb.Items.ToArray)
'For Each aa As String In lb.items
'lst.Add(aa)
'Next
sz = lst.ToArray
Dim st As String
For i As Integer = 0 To sz.Length-1
    st=st & "  " & sz(i)
Next
Dim kk As WinForm.TextBox = e.Form.Controls("TextBox1")
kk.text =st


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/6/18 19:31:00 [显示全部帖子]

 不知道你为什么要这样做。是不是这个目的?

 

Dim lb As WinForm.ListBox = e.Form.Controls("ListBox1")
Dim kk As WinForm.TextBox = e.Form.Controls("TextBox1")
kk.text = lb.ComboList.Replace("|", " ")


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/6/18 20:11:00 [显示全部帖子]

  看了,lb.Items 定义的不是string的集合,所以不能这样用。

 

Dim lb As WinForm.ListBox = e.Form.Controls("ListBox1")
Dim lst As new List(of Object)
lst.Add(lb.items)

 


 回到顶部