第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

線程間操作無效: 從不是創(chuàng)建控件“XXX”的線程訪問它。問題 路過的朋友幫忙看下

線程間操作無效: 從不是創(chuàng)建控件“XXX”的線程訪問它。問題 路過的朋友幫忙看下

蝴蝶不菲 2018-12-06 16:31:06
網上的解決方案:http://blog.csdn.net/jumtre/article/details/44927271 1:設置?CheckForIllegalCrossThreadCalls false 2:委托 ? 3:用BeginInvoke 或者異步線程 為什么我用了線程還是提示這個錯誤呢 不明白 看代碼 void GetInstance_storeSelectChanged(object sender, StoreSelectChangedEventArgs e) { if (IsOk) return; var temp=frmMain.GetInstance.dialog.Entity;; if (temp == null || temp.Count == 0) return; var sourceno = temp.Aggregate("", (current1, xxx) => current1 + (xxx.sourceno + ",")).TrimEnd(','); Task.Factory.StartNew(() => { var matappList = Voion.Core.SqlClientFactory.Instance.Query("SELECT * FROM matapp_dl WHERE docno=@docno", new { docno = sourceno }); if (matappList == null || matappList.Count == 0) return; foreach (var tagetModel in matappList) { var outlist = new stotheroutlst_pro { zbid = tagetModel.zbid, keyno = tagetModel.zbid, code = tagetModel.proitemno, productno = tagetModel.productno, seqno = 0, proitemno = tagetModel.proitemno, appqty = 1, numb = 2, lostqty = tagetModel.lostqty, sheetsqty = 3, prosheetsqty = 4, needqty = tagetModel.needqty, needsheetqty = 5, outno = "a", active_id = 6, stock_id = 7, userid = User.Idno, inputdate = DateTime.Now, sizelost = 6, retqty = tagetModel.Waitretqty, appid = 100 }; Entity.StotherOutlstProList.Add(outlist); } bindingSource.ResetBindings(false); var thread = new Thread(() => { gridView1.RefreshData(); }); thread.Start(); }); IsOk = true; } 錯誤的意思是 不是在UI線程修改了這個控件 。 GetInstance_storeSelectChanged是注冊事件回調函數? 報錯的地方? gridView1.RefreshData(); 我已經用線程里面就是一個委托 怎么還是這個 錯誤呢。 不明白
查看完整描述

1 回答

?
FFIVE

TA貢獻1797條經驗 獲得超6個贊

method(T c,Action action) where T:Control {   if(InvokeRequired)   {     Invoke(new Action(()=>action(c));   }   else     action(c); } ? bindingSource.ResetBindings(false); method(gridView1,view=>view.RefreshData());
查看完整回答
反對 回復 2018-12-09
  • 1 回答
  • 0 關注
  • 1535 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號