Usare textbox per log [vb6][santi caltabiano].txt blocco note
1. Usare textbox per log [VB6][Santi Caltabiano].txt
USARE TEXTBOX PER LOG
1) Creare un nuovo progetto
2) Aggiungere al form una textbox
a] Rinominare in txtLog
b] Impostare Multiline=true
c] Impostare ScrollBars=3-Both
d] Impostare forecolor e backcolor (ad esempio nero e verde)
3) Utilizzare la seguente routine per scrivere nel log
--------------------------------------------------------------------------------
--------------------
Private Function logWrite(ByVal v As String, Optional ByVal addCR As Boolean
= True)
If Len(txtLog.Text) > 64000 Then
txtLog.Text = Right(txtLog.Text, 63000)
End If
' Accoda codice return
txtLog.SelText = v & IIf(addCR, vbCrLf, "")
' porta il curosore alla fine
txtLog.SelStart = Len(txtLog.Text)
End Function
--------------------------------------------------------------------------------
--------------------
Pagina 1