·上一篇:VB Listview控件列宽度自动调整
·下一篇:VB 文件编码互换模块(支持 Ansi,UTF-8,Unicode(little endian),Unicode big endian)
VB 移动Combobox某项的位置
VB 移动Combox某项的位置:
- VBScript code复制代码
'cbojob当前选择向下移一位 Private Sub cmdPostpone_Click() Dim strItem As String Dim lngIndex As Long 'copy原来的数据,包括列数据 strItem = Me.cboJob & ";" & Me.cboJob.Column(1) & ";" lngIndex = Me.cboJob.ListIndex '删除原来的数据 Me.cboJob.RemoveItem lngIndex Debug.Print Me.cboJob.ListIndex '当前index变为-1 '在新位置添加数据 Me.cboJob.AddItem strItem, lngIndex + 1 Debug.Print Me.cboJob.ListIndex '当前index变为lngIndex + 1 '把index改回原来那一行 Me.cboJob.SetFocus Me.cboJob.ListIndex = lngIndex End Sub
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论