By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,179 Members | 2,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,179 IT Pros & Developers. It's quick & easy.

Form goes blank

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Your application can't update itself. Look into using a thread or a
System.Timers (not the System.Windows.Form.Timer). Or you can try
Application.DoEvents.
"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

Nov 21 '05 #2

P: n/a
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

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.