combol组合框有很多值,我按键盘向下的箭头,比如有值A、B、C、D、E、F、等,
当箭头去到F的时候,再按箭头下,又能从A开始,这些如何实现!谢谢大家。

解决方案 »

  1.   

    可以把你的combobox的值列表最后加上两项,这两项为一个空格符用来判断,比如可以这样:
    A
    B
    C
    D
    E
    F
    " "  一个空格符的值
    " "  一个空格符的值然后在Combo1_Scroll事件中
    If Combo1.List(Combo1.ListIndex) = " " Then
        Combo1.ListIndex = 0
    End If呵呵,想的个笨办法,试试My Email:[email protected]
      

  2.   

    Option ExplicitPrivate Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
        Combo1.Tag = CStr(Combo1.ListIndex)
    End SubPrivate Sub Combo1_KeyUp(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyDown And Combo1.ListIndex = Val(Combo1.Tag) Then
            Combo1.ListIndex = 0
        ElseIf KeyCode = vbKeyUp And Combo1.ListIndex = Val(Combo1.Tag) Then
            Combo1.ListIndex = Combo1.ListCount - 1
        End If
    End SubPrivate Sub Form_Load()
        Combo1.AddItem "A"
        Combo1.AddItem "B"
        Combo1.AddItem "C"
        Combo1.AddItem "D"
        Combo1.AddItem "E"
        Combo1.AddItem "F"
    End Sub
      

  3.   

    好像不行啊!不过可以跳转到第二个。Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 40 And Combo1.ListIndex = Combo1.ListCount - 1 Then
    Combo1.Refresh
    Combo1.ListIndex = 0
    End If
    End Sub