See if this helps.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) = 46 Then '// if "dot".
e.Handled = True '// cancel out the key pressed.
TextBox1.SelectedText = "- test -" '// replace the selection.
End If
End Sub
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384