不要在全局点里定义变量的时候直接赋值:
Public delimg1 As Image = GetImage("delete.ico")
Public delimg2 As Image = GetImage("deleteRow.ico")
Public delimg3 As Image = GetImage("办理.ico")
Public jzbh As Image = GetImage("sync.ico")
改为
Public delimg1 As Image
Public delimg2 As Image
Public delimg3 As Image
Public jzbh As Image
然后到afteropenproject事件赋值
delimg1 = GetImage("delete.ico")
delimg2 = GetImage("deleteRow.ico")
delimg3 = GetImage("办理.ico")
jzbh = GetImage("sync.ico")