﻿
    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        Dim T As MatchCollection = Regex.Matches(e.KeyChar, "[ء-ي]")
        If T.Count <> 0 Then
            e.Handled = True
            TextBox1.Text = TextBox1.Text & Regex.Replace(e.KeyChar, "([ء-ي])", "$1 ")
            TextBox1.SelectionStart = TextBox1.TextLength
        End If
    End Sub