how do i make a period instead of a comma if it's at the end of the textbox?
when one of my checkboxes is checked, it adds something to my textbox in the format "phrase." how do can i make the period turn into a comma then phrase and then a period (, phrase.) if it's the last item in the textbox?
i've tried this and all i get is an infinite loop where the textbox keeps filling up with empty strings:
Code:
Private Sub ListTxt_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PreviewTxt.TextChanged
Dim Flag As Boolean
Flag = False
If Flag = False Then PreviewTxt.Text = PreviewTxt.Text.Replace(".", ", ")
If PreviewTxt.Text.EndsWith(".") = False Then
PreviewTxt.Text += "."
Flag = True
End If
End Sub
(the flag was to try to avoid the infinite loop)