添加代码
private static Frm_ImageDisplay _instance;
public static Frm_ImageDisplay Instance
{
get
{
if (_instance == null)
{
_instance = new Frm_ImageDisplay();
}
return _instance;
}
}
private void frm_ImageWindow_FormClosing(object sender, FormClosingEventArgs e)
{
_instance = null;
}
跨窗口调用:
把Modifiers设置为Internal,
调用窗口的方法:
Frm_ImageDisplay.Instance.Show(this.dockPanel1, DockState.Document);//停靠在dockpanel上
Frm_ImageDisplay.Instance.Show();//直接窗口显示
Frm_ImageDisplay.Instance.imageCtl1.HwcReadImage("");