Put something like
textBox1.Text = textBox1.Text.Replace("::", "0000:0000")
event of the textbox.
Or if you want it to happen as the user types then put it in the
event - not my favourite.
I'm guessing you could have several of these so I've tidied this up a bit as follows:
I created a dictionary of things you want to replace with things you want to replace them with, and populated it in a convenient place (in my case Form_Load)
Dim transpose As Dictionary(Of String, String) = New Dictionary(Of String, String)
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
I then created an extension method for strings to do all of the substitutions which I placed in Extensions.vb in my project
<Extension()> Public Function ReplaceAll(ByVal InputValue As String, transpose As Dictionary(Of String, String)) As String
Dim s As String = InputValue
For Each kvp As KeyValuePair(Of String, String) In transpose
s = s.Replace(kvp.Key, kvp.Value)
I can then use that method in the validating event as above...
Private Sub TextBox1_Validating(sender As System.Object, e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
TextBox1.Text = TextBox1.Text.ReplaceAll(transpose)
Note you will also need