Beispiel #1
0
        private void BackgroundWorker1_ProgressChanged(object sender,
                                                       ProgressChangedEventArgs e)
        {
            CurrentText = Clipboard.GetText();

            // only if clipboard was not empty
            if (CurrentText.Length > 0)
            {
                if (CurrentText.CompareTo(PreviousText) != 0)
                {
                    PreviousText = CurrentText;
                    itemList.Items.Insert(0, CurrentText.ToString());
                    // select current item
                    itemList.SelectedIndex = 0;
                }
            }
        }