Exemple #1
0
 public void AddItemsThreadSafe(ListBox l, String s)
 {
     if (l.InvokeRequired)
     {
         AddItemsDelegate mydelegate = new AddItemsDelegate(AddItemsThreadSafe);
         l.Invoke(mydelegate, new object[] { l, s });
     }
     else
     {
         l.Items.Add(s);
     }
 }
Exemple #2
0
        public void AddItemsThreadSafe(ListBox l, String s)
        {
            if (l.InvokeRequired)
            {
            AddItemsDelegate mydelegate = new AddItemsDelegate(AddItemsThreadSafe);
            l.Invoke(mydelegate, new object[] { l, s });

            }
            else {
            l.Items.Add(s);
            }
        }