Yes, you can do it with the door library. Here is some sample code:
Sub Globals
'Declare the global variables here.
'Uses the Door library
'Add an object called obj
'Add an event called TB1Click
'Now, when you run this program the textbox detects a click and generates a message box.
End Sub
Sub App_Start
Form1.Show
AddTextBox("Form1","TextBox1",75,40,75,22,"Textbox")
obj.New1(False)
obj.FromControl("TextBox1")
TB1Click.New1(Obj.Value,"Click")
End Sub
Sub TB1Click_NewEvent
Msgbox("TextBox was clicked!")
End Sub