Run your database operation in a seperate thread. This will prevent the UI
from locking/not responding.
Private Sub myDBOperation()
' long running db operation..
End Sub
Private m_Thread As New _
System.Threading.Thread(AddressOf myDBOperation)
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
m_Thread.Start()
End Sub
Note that the target of AddressOf in the Thread's constructor can only be a
Sub and not a Function.
More on threading:
http://msdn.microsoft.com/library/de...ClassTopic.asp http://msdn.microsoft.com/library/de...syncprocvb.asp
hope that helps..
Imran.
"JohnGates" <Jo*******@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
In VB.net, I have win form programs that do database update operations
that
take several minutes or longer. Several actions such as switching windows
or
clicking a control during these operations leave me with a blank form (all
white space inside the form borders) or with a frozen form that will not
display refreshed controls. When the db operations are done, the forms
repaint just fine. What's happening and what can I do about it? Thanks.
--
John Gates