If rsSearch.EOF = False Then
Label.Visible = True
For ncntr = 1 To rsSearch.RecordCount
lstCustom.AddItem rsSearch.Fields("CustomNO")
rsSearch.MoveNext
Next
........
End If Label.Visible = False 在上面代码中.我想实现的功能是查询数据前 label的visible为真,数据查寻结束后Label就消失了.但是我在实验过程中,总是查寻跟这两个执行过程同时实现,或者是先查寻然后那两个再执行的,请问我想要的效果如何实现?谢谢.
Label.Visible = True
For ncntr = 1 To rsSearch.RecordCount
lstCustom.AddItem rsSearch.Fields("CustomNO")
rsSearch.MoveNext
Next
........
End If Label.Visible = False 在上面代码中.我想实现的功能是查询数据前 label的visible为真,数据查寻结束后Label就消失了.但是我在实验过程中,总是查寻跟这两个执行过程同时实现,或者是先查寻然后那两个再执行的,请问我想要的效果如何实现?谢谢.
程序運行太快,眼睛看不出變化
Label.Visible = True
DoEvents延时:
增加控件:Timer
timer1.Enabled=true
if timer1.Interval=0 then
...
end if是这样用吗?
不要使用延时,不但没用,而且危险。
PanelReadDatabase.Visible = True
Me.Refresh '加上這一句
For ncntr = 1 To rsSearch.RecordCount
lstCustom.AddItem rsSearch.Fields("CustomNO")
rsSearch.MoveNext
Next
End If
也可以這樣: If rsSearch.EOF = False Then
PanelReadDatabase.Visible = True
DoEvents '加上這一句
For ncntr = 1 To rsSearch.RecordCount
lstCustom.AddItem rsSearch.Fields("CustomNO")
rsSearch.MoveNext
Next
End If在你的数据库查寻很慢的问题. 中回答了問題.http://topic.csdn.net/u/20080212/16/eed137c0-fe73-4f26-b1f0-baf29041d41b.html
Label.Visible = True
Doevents
With lstCustom
.Visible=False
For ncntr = 1 To rsSearch.RecordCount
.AddItem rsSearch.Fields("CustomNO")
rsSearch.MoveNext
Next
.Visible=True
End With
这样一来可以让Label及时显示出来,
二来,当你数据量很大的时候可以极大的提高程序运行速度
If rsSearch.EOF = False Then
Timer1.Interval = 1000
Timer1.Enabled = True
For ncntr = 1 To rsSearch.RecordCount
lstCustom.AddItem rsSearch.Fields("CustomNO")
rsSearch.MoveNext
Next
........
End If Timer1.Enabled = False
Label.Visible = False 'Timer 事件
Private Sub Timer1_Timer()
Label1.Visible = True
Label1.Refresh
End Sub
dim Wait as double
Dim dTime As Double
dtime = Timer
Do While (Timer - dtime) < Wait
If Timer < dtime Then dtime = Timer
DoEvents
Loop
end sub
Label.Visible = True
Label.Refresh '增加这一行