我想在一些操作后使用线程并关闭我的表单。但是我得到一个交叉线程错误.solutions?
new System.Threading.Thread(s =>
{
Close; }).Start();
答案 0 :(得分:-1)
你必须关闭(); WPF中的声明
Application.Current.Dispatcher.Invoke(() =>
{
// Code to run on the UI thread.
});
并在此为WinForms
this.BeginInvoke(new MethodInvoker(delegate
{
// Code to run on the UI thread.
});