WPF 每次只打开一个窗口

        if(downListControl == null || downListControl.IsVisible == false) {
                downListControl = new DownloadListControl();
                downListControl.Show();
            } else {
                MessageBox.Show("对不起,下载窗口也打开!不要重复打开");
                downListControl.Activate();
                downListControl.WindowState = WindowState.Normal;
            }

PS:downListControl  是窗口的实例对象名

posted on 2015-09-20 11:39  ~紫鱼~  阅读(1066)  评论(0编辑  收藏  举报