以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 如何上移、下移 CheckedListBox中的选定项  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=86461)

--  作者:lzzhx
--  发布时间:2016/6/17 17:17:00
--  [求助] 如何上移、下移 CheckedListBox中的选定项
请教老师:如何上移、下移 CheckedListBox中的选定项?
[此贴子已经被作者于2016/6/17 17:24:58编辑过]

--  作者:大红袍
--  发布时间:2016/6/17 18:54:00
--  

 比如,上移,参考

 

Dim clbx As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
If clbx.SelectedIndex <= 0 Then
    msgbox("不能再上移")
Else
    Dim idx = clbx.SelectedIndex
    clbx.Items.Insert(idx-1,clbx.SelectedValue)
    clbx.Items.RemoveAt(idx+1)
    clbx.SelectedIndex = idx-1
End If