using System.Linq; if (!txtBox_ID_List.Lines.Contains(DataInID)) txtBox_ID_List.Text += DataInID + "\r\n";