<分区>
Possible Duplicate:
Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on
public void CheckUnusedTabs(string strTabToRemove)
{
TabPage tp = TaskBarRef.tabControl1.TabPages[strTabToRemove];
tp.Controls.Remove(this);
TaskBarRef.tabControl1.TabPages.Remove(tp);
}
我试图使用上面的代码关闭 Windows 应用程序的选项卡控件中的选项卡,但我遇到了错误:
Cross-thread operation not valid.
如何解决?