注册 登录
编程论坛 C# 论坛

请指教treeView1.Invoke

xwheat 发布于 2019-09-02 00:52, 1738 次点击
   
System.NullReferenceException: 未将对象引用设置到对象的实例。

private void PapulateTree(
      Dictionary<string, ChamferChecker.Profile> profiles)
    {
      if (this.treeView1.InvokeRequired)
      {
        this.treeView1.Invoke(new Action(delegate
        {
            this.PapulateTree(profiles);
        }));
        return;
1 回复
#2
xwheat2019-09-03 23:32
回复 楼主 xwheat
解决了
private void PapulateTree(
      Dictionary<string, ChamferChecker.Profile> profiles)
    {
      if (this.treeView1.InvokeRequired)
      {
        this.treeView1.Invoke(new Action(delegate
        {
            new mainform().PapulateTree(profiles);
        }));
        return;
1