Still can't make it work, heres the complete text for the form:
VERSION 5.00
Begin
VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin
VB.TextBox txt
Height = 495
Index = 0
Left = 1800
TabIndex = 0
Text = "Text1"
Top = 1320
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents txtObj As TextBox
Private Sub Form_Load()
Set txtObj = Controls.Add("
VB.TextBox", "txt")
With txtObj
' .Index = 1
.Visible = True
.Text = "TEST"
.Top = 120
.Left = 120
.Width = 5000
.Height = 300
End With
End Sub
Private Sub txt_Change(Index As Integer)
MsgBox "ok"
End Sub
THANKS