473,763 Members | 7,622 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2450
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.DoE vents.
"JohnGates" <Jo*******@disc ussions.microso ft.com> wrote in message
news:9F******** *************** ***********@mic rosoft.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.Threadin g.Thread(Addres sOf myDBOperation)

Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) 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*******@disc ussions.microso ft.com> wrote in message
news:9F******** *************** ***********@mic rosoft.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
2924
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 form order to do that ? My point is for the client to be able to re-read the modified data.
2
4092
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 query, I set the 2 primary key values equal to the 2 control values on my form. When I input a value to these 2 controls the query finds the correct record, so I know my query with the criteria works. My problem is trying to get the output values...
4
1386
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 select people associated with the project, from another table. When I enter a new record and assign people to a project everything is fine. Then when I change the id of the record (project id) and save, the subform goes blank and people are still...
1
3365
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 many hours and for which projects they've already made entries. To do this, I created a query based on the same table with criteria pointing to the current user, and the week selected in the main form. This seems to work fine except the...
1
3368
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 form to scroll thorugh the orders i can get to the end where the form expects you to make a new order. but i have a button to add a new order. i want to stop the user being able to go past the last record in the orders table. or enable them to...
7
3821
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 database search that I am unable to figure out how to access. (The search is implemented in Php/MySQL.) The user enters search values for: name, address1, city, .... etc., ..... and for each of these they also select whether the search should...
5
1852
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 mysql database. I know that when I "submit" (post) the form, everything goes blank, and the insert query is not run.
22
2086
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! DoCmd.OpenForm stDocName, , , stLinkCriteria This works really well except that, as expected, I can't add new records. Interestingly, you can click the "next record" button and it will show a blank form (and then grey out) but the Entrainment_ID goes blank...
6
1475
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 object" The form is now completely blank and I can only see anything if I switch to design view. I am kaking changes that will break the form admittedly but those are bugs of course and I expect to be able to fix them.
1
1349
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" opens, it always goes to the first GP in the table. Is there anyway which I can make it so when "Form2" loads, it automatically goes to create a new blank record instead of going to the first record in the table? I've posted up the Form_Load code...
0
9564
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9823
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.