0
私は楽しいと私はNotficationWindow.Show()
を使用してウィンドウを呼び出すしようとしているプログラムを作っていると私はそれをスリープを使用して設定時間後に閉じて、エラー:Cannot set Visibility or call Show, ShowDialog, or WindowInteropHelper.EnsureHandle after a Window has closed.
ではなく、最良の方法、それは彼らがイム幸せ動作するかどうか、ここに私のコードがありますので、それが私的使用のためです:
メインウィンドウ: C#でリモートで開いた後にウィンドウを閉じることができませんWPF
private void ShowNoti_Click(object sender, RoutedEventArgs e)
{
XuriNotification Noti = new XuriNotification();
Noti.Show();
}
XuriNotification.xaml.cs:
public XuriNotification()
{
InitializeComponent();
var desktopWorkingArea = System.Windows.SystemParameters.WorkArea;
this.Left = desktopWorkingArea.Right - this.Width;
this.Top = desktopWorkingArea.Bottom - this.Height;
System.Threading.Thread.Sleep(2000);
System.Windows.Forms.Application.Exit();
}
私はそのコードを使用すると、私はエラーを得なかったが、窓が、私はそれを修正し、 – ZerterCodes
は気にしないで閉じたことがありません – ZerterCodes