0
我真的需要處理案例的幫助,目前爲止我只是在學習它,但卻無法獲得可以改變文本框背景的下拉菜單。使用案例更改背景顏色| Visual Studio 2008
Private Sub cbColours_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbColours.SelectedIndexChanged
Select Case colours
Case Is = "Red"
txtSpace.BackColor = Color.Red
Case Is = "Blue"
txtSpace.BackColor = Color.Blue
Case Is = "Green"
txtSpace.BackColor = Color.Green
End Select
End Sub
它沒有做任何事情...
在下拉菜單中,它具有
紅,藍,每行
綠色的當值(例如綠色),然後將文本框更改爲所選顏色。
很多幫助表示讚賞:)
如果/當在第一時間變量「顏色」設置?如果它是空白的,所有三種情況都會失敗。嘗試添加「Case Else」 – gooch 2010-03-18 16:12:00