0
我正在使用BackgroundWorker,我需要使用委託函數來查看是否檢查ListViewItem或不,但我不斷收到交叉線程錯誤。這一定是我編寫它的方式。任何幫助?VB.NET委託函數返回布爾值
Dim delListViewItemChecked As ListViewItemCheckedDelegate = AddressOf ListViewItemChecked
delListViewItemChecked.Invoke(ListViewPhotos, 0)
Private Delegate Function ListViewItemCheckedDelegate(ByVal listView As ListView, ByVal index As Integer) As Boolean
Private Function ListViewItemChecked(ByVal listView As ListView, ByVal index As Integer) As Boolean
If listView.Items(index).Checked = True Then
Return True
Else
Return False
End If
End Function
可能重複[?如何更新從C#另一個線程的GUI(http://stackoverflow.com/questions/661561/how-更新-gui-from-another-thread-in-c) – 2014-11-02 15:29:58
它不是重複的。 vb.net和C#是不同的語言。 – xpda 2014-11-03 17:12:44