vb程序编程,就是combo下拉菜单中,那些选项的排列是怎么样的
PrivateSubCombo1_KeyPress(KeyAsciiAsInteger)DimiAsIntegerIfKeyAscii=13ThenCombo1.List...
Private Sub Combo1_KeyPress(KeyAscii As Integer)
Dim i As Integer
If KeyAscii = 13 Then
Combo1.List(Combo1.ListCount) = Combo1.Text
List1.Clear
For i = 0 To Combo1.ListCount - 1
If Len(Trim(Combo1.List(i))) < 3 Then
List1.AddItem Combo1.List(i)
End If
Next i
End If
End Sub
Private Sub Form_Load()
Combo1.AddItem "西瓜": Combo1.AddItem "苹果": Combo1.AddItem "橘子"
Combo1.AddItem "葡萄": Combo1.AddItem "哈密瓜"
Combo1.AddItem "火龙果": Combo1.AddItem "柚子"
Combo1.List(0) = "梨子": Combo1.List(7) = "猕猴桃"
End Sub
这个程序运行时combo下拉时那些排列为什么不是按照我输入的顺序,而且为什么没西瓜项。
还有这个程序是什么意思额。哎,头疼 展开
Dim i As Integer
If KeyAscii = 13 Then
Combo1.List(Combo1.ListCount) = Combo1.Text
List1.Clear
For i = 0 To Combo1.ListCount - 1
If Len(Trim(Combo1.List(i))) < 3 Then
List1.AddItem Combo1.List(i)
End If
Next i
End If
End Sub
Private Sub Form_Load()
Combo1.AddItem "西瓜": Combo1.AddItem "苹果": Combo1.AddItem "橘子"
Combo1.AddItem "葡萄": Combo1.AddItem "哈密瓜"
Combo1.AddItem "火龙果": Combo1.AddItem "柚子"
Combo1.List(0) = "梨子": Combo1.List(7) = "猕猴桃"
End Sub
这个程序运行时combo下拉时那些排列为什么不是按照我输入的顺序,而且为什么没西瓜项。
还有这个程序是什么意思额。哎,头疼 展开
展开全部
Combo1.List(0) = "梨子" 这句是设置列表第一个项目的内容 也就是 西瓜被替换成梨子了
顺序没错
Combo1.AddItem "西瓜"
Combo1.AddItem "苹果"
Combo1.AddItem "橘子"
Combo1.AddItem "葡萄"
Combo1.AddItem "哈密瓜"
Combo1.AddItem "火龙果"
Combo1.AddItem "柚子"
Combo1.List(0) = "梨子"
Combo1.List(7) = "猕猴桃"
顺序没错
Combo1.AddItem "西瓜"
Combo1.AddItem "苹果"
Combo1.AddItem "橘子"
Combo1.AddItem "葡萄"
Combo1.AddItem "哈密瓜"
Combo1.AddItem "火龙果"
Combo1.AddItem "柚子"
Combo1.List(0) = "梨子"
Combo1.List(7) = "猕猴桃"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询