Private
a
As
Double
Private
Sub
Combo1_Click()
'1位小数,系数用10
a = Combo1.ItemData(Combo1.ListIndex) / 10
MsgBox a, 32
End
Sub
'设置时,把 Combo1 的Style属性设置为2
Private
Sub
Form_Load()
Combo1.AddItem
"粘土"
Combo1.AddItem
"粉土"
Combo1.AddItem
"粉质粘土"
Combo1.AddItem
"砂土"
'ItemData 的值只能为整数
' 按你的数据实际情况选择适当的系数
' 1位小数就用10倍,2位小数就用100倍,等等
Combo1.ItemData(0) = 3
' 具体值你自己输入
Combo1.ItemData(1) = 1
Combo1.ItemData(2) = 8
Combo1.ItemData(3) = 5
End
Sub