1
嗨,我正在創建一個類似於應用程序的聊天。你能幫助我嗎? 當我進入一個新的消息是越來越取代了最初顯示的消息:(如何在不替換第一個輸入的情況下在文本框中添加新顯示
請參考下面我的代碼:
Private Sub saveMessage()
FileName = Format(Now, "MMddyyyyhhmmss")
Dim RecipientFile As String
If CurrentRecipient = "Edward" Then
RecipientFile = RecipientFolder & FileName & ".txt"
ElseIf CurrentRecipient = "Criziel" Then
RecipientFile = RecipientFolder & FileName & ".txt"
ElseIf CurrentRecipient = "Jerome" Then
RecipientFile = RecipientFile & FileName & ".txt"
Else
Exit Sub
End If
Dim Writer As IO.StreamWriter
Writer = New IO.StreamWriter(RecipientFile)
Writer.Write(MainRichTextBox.Text)
Writer.Close()
ShowtextRichTextBox.Text = (User & " : ") & MainRichTextBox.Text
MainRichTextBox.Clear()
End Sub
預先感謝您:*
阿魯娜嗨!有效 !非常感謝 ! :* – Bele