我的代碼有什麼問題?它不會在刪除文件時更新TextBox和ProgressBar。 Imports System.Windows.Threading
Imports System.IO
Class MainWindow
Private Sub bt_Click(ByVal sender As Object,
ByVal e As RoutedEventArgs) Hand
Hans Passant給了我一個很好的回答here,所以我想請求更多的細節來試圖瞭解Application.Run()的工作方式。 據我所知,從文檔看來,Application.Run()似乎在當前線程上啓動了一個消息循環,這反過來又使它能夠處理用戶輸入(是嗎?)。重載版本Application.Run(Form)基本上是一樣的,只有當表單關閉時才存在,並且默認顯示錶單。 這就提出了幾個問題:
我對WPF比較陌生。我檢查了一些代碼,看起來像這樣: private void button_Click(object sender, RoutedEventArgs e)
{
//Queue on dispatcher in the background so it doesn't make the UI slow
Dispatcher.BeginInvoke(new d