我有一个COMBOBOX控件(combo1)
使用如:
   combo1.AddItem "Judy Phelps"
   combo1.ItemData(List1.NewIndex) = 42310
   combo1.AddItem "Chien Lieu"
   combo1.ItemData(List1.NewIndex) = 52855
   combo1.AddItem "Mauro Sorrento"
   combo1.ItemData(List1.NewIndex) = 64932
   combo1.AddItem "Cynthia Bennet"
   combo1.ItemData(List1.NewIndex) = 39227
现在我已经知道combo1的itemdata的值是52855,如何在程序启动时让"chien lieu"成为默认条目呢?谢谢。

解决方案 »

  1.   

    在Form_load 中加入
    combo1.Text="Chien Lieu"
      

  2.   

    或是Combo1.ListIndex = 1即选中第二项
      

  3.   

    但我现在主要是不知道listindex的值和其他的。我知道52855的值是控件的ITEMDATA值。那我该怎么办呢。
      

  4.   

    '用遍历的方法来实现
        Dim intI As Integer
        
        For intI = 0 To Combo1.ListCount - 1
            If Combo1.ItemData(intI) = 52855 Then
                Combo1.ListIndex = intI
            End If
        Next