If TextBox1.Text.Trim.Contains(" ") Then If MsgBox("احذف الفراغات او انقر نعم لحذفها نيابة عنك", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "") = MsgBoxResult.Yes Then TextBox1.Text = TextBox1.Text.Trim.Replace(" ", String.Empty) End If End If