Possible Duplicate:
Cross-thread operation not valid: Control accessed from a thread other than the thread it was created onBắt hoạt động Chữ thập sợi không hợp lệ
public void CheckUnusedTabs(string strTabToRemove)
{
TabPage tp = TaskBarRef.tabControl1.TabPages[strTabToRemove];
tp.Controls.Remove(this);
TaskBarRef.tabControl1.TabPages.Remove(tp);
}
Tôi cố gắng để đóng một tab trong TabControl của cửa sổ ứng dụng bằng cách sử dụng mã trên và tôi gặp phải lỗi:
Cross-thread operation not valid.
Làm thế nào để giải quyết điều này?
thậm chí tìm kiếm trên "chuỗi chéo" trong SO cung cấp nhiều kết quả ... – Stormenet