怎么实现选择combobox控件的一个值,便可在label中显示得到相应的值
如何实现选择combobox控件的一个值,便可在label中显示得到相应的值。
我现在的情况是,当选择combobox的List中的一个值后,需单击command按扭,才可在label中显示我所要得到的值,代码如下:
Private Sub Command2_Click()
If Combo1.Text = "储能 " Then
Label11.Caption = "弹簧等 "
End If
If Combo1.Text = "固定 " Then
Label11.Caption = "螺钉、螺母、垫圈、挡圈、轴承、套筒、键、销等 "
End If
End Sub
我现在要实现,只要选择combobox中的“储能”,不通过单击command2按扭,便能在label1中显示字样“弹簧等”字样,应该很简单,请指教。。谢谢!!~~
------解决方案--------------------
应该在下面的事件里下代码:
Private Sub Combo1_Change()
If Combo1.Text = "储能 " Then
Label11.Caption = "弹簧等 "
End If
If Combo1.Text = "固定 " Then
Label11.Caption = "螺钉、螺母、垫圈、挡圈、轴承、套筒、键、销等 "
End If
End Sub
我现在的情况是,当选择combobox的List中的一个值后,需单击command按扭,才可在label中显示我所要得到的值,代码如下:
Private Sub Command2_Click()
If Combo1.Text = "储能 " Then
Label11.Caption = "弹簧等 "
End If
If Combo1.Text = "固定 " Then
Label11.Caption = "螺钉、螺母、垫圈、挡圈、轴承、套筒、键、销等 "
End If
End Sub
我现在要实现,只要选择combobox中的“储能”,不通过单击command2按扭,便能在label1中显示字样“弹簧等”字样,应该很简单,请指教。。谢谢!!~~
------解决方案--------------------
应该在下面的事件里下代码:
Private Sub Combo1_Change()
If Combo1.Text = "储能 " Then
Label11.Caption = "弹簧等 "
End If
If Combo1.Text = "固定 " Then
Label11.Caption = "螺钉、螺母、垫圈、挡圈、轴承、套筒、键、销等 "
End If
End Sub