Originariamente inviato da RastaRego
[VB6] Creazione automatica di text box

--------------------------------------------------------------------------------

Private Sub txtq_LostFocus(index As Integer)
Dim Y As Integer
Dim X As Currency
Y = 0
Do While index < 2
If txtq(index).Text = "" Then
Exit Sub
End If
Data1.RecordSource = "select * from articoli_catalogo where cod_art='" & cod1(index).Text & "'"
Data1.Refresh
Y = Y + 300
If index = txtq.count - 1 Then
Load cod1(cod1.count)
Load txt1(txt1.count)
Load txtq(txtq.count)
Load txtpu(txtpu.count)
Load txtimp1(txtimp1.count)
End If
cod1(index + 1).Move 350, 1820 + Y
cod1(index + 1).Visible = True
cod1(index + 1).Text = ""
cod1(index + 1).SetFocus
txt1(index + 1).Move 1910, 1820 + Y
txt1(index + 1).Visible = True
txt1(index + 1).Text = ""
txtq(index + 1).Move 6840, 1820 + Y
txtq(index + 1).Visible = True
txtq(index + 1).Text = ""
txtpu(index + 1).Move 7690, 1820 + Y
txtpu(index + 1).Visible = True
txtpu(index + 1).Text = ""
txtimp1(index + 1).Move 9840, 1820 + Y
txtimp1(index + 1).Visible = True
txtimp1(index + 1).Text = ""
index = index + 1
Call importo
Loop
End Sub
Per nuova riga intendi l'istruzione "load"?! Allora prova a guardare nelle prime righe del codice l'istruzione do while index < 2..
E' un tentativo in quanto non posso provare il codice...

Cmq ti consiglio di usare With per 1) risparmiare tempo 2) codice più preciso e leggibile

Es. With txtimp1(index + 1)
.Move 9840, 1820 + Y
.Visible = True
.Text = ""
end with

ciao