473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Form goes blank

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
2 2430
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
2
by: neptune | last post by:
I built a form to access a query with a 2 field primary key. It should use 2 controls to find the unique record and display the other field values on the form. In the criteria section of the...
4
by: David Gunnarsson | last post by:
I'm using Access as a front-end to a MySql database, through ODBC. I have a form set up for entering information about projects and that form has, among other things, a subform where you can...
1
by: New2Access | last post by:
Hi, I have a form thats used to enter records into a table. The table and form have fields for Name, week, project, and hours. To assist users, I wish to add a subform that will show them how...
1
by: leemansiuk | last post by:
hi, i wonder if anyone can help with this problem i cant seem to work out. i have a bound form linked to an orders table, including some required fields. when i use the navigation buttons of the...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
5
by: eholz1 | last post by:
Hello PHP, I am having a problem. I know the area of the problem, but not how to solve it. It has to do with a php page with a form on it, and I am trying to perform an insert query into my...
22
AccessIdiot
by: AccessIdiot | last post by:
Anyone getting sick of me yet? :D I have a button on my form that opens a new form but with a filter: stDocName = "frm_Specimen_Entrainment" stLinkCriteria = "=" & Me! ...
6
by: Deano | last post by:
Every once in a while I modify one particular form (could be anything from adding code to tweaking properties as far as I can see) and upon loading I get; "You can't assign a value to this...
1
by: HotKgon | last post by:
I would like appreciate some help on a issue I am having at the moment. On "Form1" I have a button which opens up "Form2". "Form2" is used to enter in GP data. The issue is that When "Form2"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.