以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  CheckedListBox项目连续移动问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=126652)

--  作者:fytea
--  发布时间:2018/10/25 21:11:00
--  CheckedListBox项目连续移动问题

在复选列表框中,移动选中的项目,我用的是

Dim chl As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
Dim item As String = chl.SelectedValue
Dim idx As Integer = chl.SelectedIndex
chl.Items.RemoveAt(chl.SelectedIndex)
chl.Items.Insert(idx-1,item) \'向上移动

选一次只能移动一位,怎么才能选一次,连续移动


--  作者:有点蓝
--  发布时间:2018/10/26 9:04:00
--  
Dim chl As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
Dim item As String = chl.SelectedValue
Dim idx As Integer = chl.SelectedIndex
chl.Items.RemoveAt(chl.SelectedIndex)
chl.Items.Insert(idx-1,item) \'向上移动
chl.SelectedValue = item