Hi, i have a textbox name txtCommand. When the user presses a button i want the txtCommand.text to call a sub ie
Call txtCommand.txt
but im not able to do that
How would i be able to do that instead of going
select case txtCommand.txt
case "Sub1"
call sub1()
case "Sub2"
call sub2()
end select
Thx
![]()

Call <STRING AS COMMAND>
Visual Basic Nov.
telectro
iSUBBU
I would assume your trying to do the following for a button click event
Public Class Form1
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Select Case TextBox1.Text
Case "Sub1"
Call Sub1()
Case "Sub2"
Call Sub2()
End Select
End Sub
Sub Sub1()
End Sub
Sub Sub2()
End Sub
End Class
or for a keypress while in the textbox control
Public Class Form1
Sub Sub1()
End Sub
Sub Sub2()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Select Case TextBox1.Text
Case "Sub1"
Call Sub1()
Case "Sub2"
Call Sub2()
End Select
End Sub
End Class
RLHegde
I'd suggest doing a search on reflection and "dynamic binding"
- Scott
OpenBlue
No that's exactly what im not trying to do
. I just want to call the sub directly from the textbox