ComboBox问题,在线等~~~
我想把一些指令顺序排列在一个ComboBox中,点击 "执行 "button时能够顺序执行ComboBox中的这些指令,能实现么?该怎么做?
如一些发送给串口的指令,我点 "执行 "后,这些排列在ComboBox中的指令就一条一条的连续发送出去.
谢谢,帮我!
[解决办法]
Public Class ActionsDemo
Private gActions As String() = New String() { "A ", "B ", "C "}
Public ReadOnly Property Actions() As String()
Get
Return gActions
End Get
End Property
Private Sub [do](ByVal action As String)
Select Case action
Case "A "
DoA()
Case "B "
DoB()
Case "C "
DoC()
End Select
End Sub
Private Sub DoA()
Console.WriteLine( "A ")
End Sub
Private Sub DoB()
Console.WriteLine( "B ")
End Sub
Private Sub DoC()
Console.WriteLine( "C ")
End Sub
Public Sub DoAll()
For Each action As String In gActions
[do](action)
Next
End Sub
End Class