問題:
Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore
例子:
我在DataGridView的CellEnter事件
寫入以下的CODE:「DataGridView1.CurrentCell = DataGridView1(0,0)」
當進入(0,0)時, 因觸發CellEnter事件, 又將CurrentCell = (0,0), 又再次觸發事件
因此形成一個無窮迴圈
datagridview中CellValidating中出现无限循环
參考:
UI开发时, UI消息处理过程混乱的解决方法
Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function
RowLeave Event - Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function
DataGridView 控制項 (Windows Form)
沒有留言:
張貼留言