Selections i RichTextBox
Hej Xperter!Jeg er igang med at lave et lille chat program, og jeg har lavet en sub til at smidde teksten ned i en RichTextBox med...
Jeg får fejlen:
Error 1: Property access must assign to the property or use its value.
MsgBox'en viser lænden af teksten helt fint.
Her er min sub:
Public Sub DoChat(ByVal Type As String, ByVal ChatText As String)
Dim TextLen As Integer
txtChat.SelectAll()
TextLen = txtChat.SelectionLength
MsgBox(TextLen)
With txtChat
.SelectionStart(TextLen)
Select Case Type
Case "Chat"
.SelectionColor = Color.Black
Case "System"
.SelectionColor = Color.Red
End Select
.AppendText(vbCrLf & "[22:22] " & ChatText)
End With
End Sub
