我写了这个样本来展示我的问题。 我有一个进度条(在异步Sub中但问题也在同步中) 当我增加价值时,我在视频上看不到任何内容。
只有在Sub的末尾才能看到现在位于值顶部的进度条。 为什么?
Private Sub Btn_ProgressBar_Click(sender As Object, e As RoutedEventArgs) Handles Btn_ProgressBar.Click
Me.BarraProgresso.Minimum = 0
Me.BarraProgresso.Maximum = 100
Me.BarraProgresso.Value = 0
For i As Integer = 1 To 1000
If i / 100 = CInt(i / 100) Then
Me.BarraProgresso.Value = CInt(i / 100)
End If
For KK As Integer = 0 To 9000000
Dim _MyApple As String = "Red Apple"
Next
Next
End Sub
答案 0 :(得分:0)
您的按钮单击处理程序在UI线程上同步调用,您忙着等待。在处理程序返回之前不会呈现任何内容。这样做效果更好:
SELECT values.* FROM
(SELECT MAX(id) AS id FROM miscall_records GROUP BY mobile_no) AS keys
LEFT JOIN miscall_records AS values
ON keys.id = values.id
这是C#而不是VB,但我认为翻译是可管理的。 : - )