VB2005中使用Label控件显示文字问题求助
VB2005中使用Label控件,如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "正在进行数据处理,请稍候..."
Dim bh1 As String
Dim xm1 As String
Dim zjls1, i, jb1, sj1, bj1, kg1, hx1, nf1, yf1, ts1 As Integer
Dim hxts1, kh1 As Double
Dim SQLString, Msg As String
SQLString = "SELECT bh As 编号,xm As 姓名,date8 As 日期 From kqsj WHERE month(date8) ='" & yf & "'"
Dim UserTable1 As DataTable = DBOperation.DBOperate(SQLString, Msg)
For i = 0 To UserTable1.Rows.Count
jb1 = jb1 + UserTable1.Rows(i).Item(4)
sj1 = sj1 + UserTable1.Rows(i).Item(5)
Next
Label1.Text = "数据处理完毕!"
End Sub
为什么运行时,Label1.Text 中只有一个空框,不显示 "正在进行数据处理,请稍候..."文字,而在程序运行快结束时Label1显示 "数据处理完毕!"文字?是什么原因导致Label1第一次不显示文字而执行到第二次时才显示文字?谢谢。
[解决办法]
Label1.Text = "正在进行数据处理,请稍候..."
Label1.Refresh