public ListBox addlstbx(Tree.Node n, ListBox lb1, bool fl) { if (fl) lb1.Items.Clear(); for (int i = 1; i < n.getlen() + 1; i++) lb1.Items.Add(n.getnode(i - 1).getname()); return lb1; }
public void SetCom(Tree.Node n) { if (listBox1.InvokeRequired) { listBox1.Invoke(new Action<Tree.Node>((s) => listBox1 = shf.addlstbx(s, listBox1, true) ), n); } else { listBox1 = shf.addlstbx(n, listBox1, true); } }