I have a long process I run that needs to be complete before the user can continue. I can change the cursor to an hourglass, but I want to update the Status Strip on the bottom during the process. I set the statusstrip label to "Downloading... ", but it will not show up on the form. I need to display this message before it starts the process. I can put a thread.sleep for 1 second after I do the initial process, but that seems sloppy to me. Any suggestions? Here is my code launched from a button click:
'update the label--This does not show because the process starts before the UI updates
slDBList.Text = "Retrieving Databases..."Tr yMe.Cursor = Cursors.WaitCur sorDim lstServers As List(Of String)'set to false in case of an error boolServersLoad ed = FalseboolDBLoad ed = False'clear the servers list cbServers.DataS ource = Nothing'clear the databases list dbDatabases.Dat aSource = NothingIf chkSort.Checked = True ThenlstServers = GetSqlServers(T rue)ElselstServ ers = GetSqlServers(F alse)End IfcbServers.Dat aSource = lstServers'set to true to enabled the selected index change on the dropdown boolServersLoad ed = TrueslDBList.Te xt = ""Catch ex As ExceptionMessag eBox.Show("Erro r loading server list. Error: " & ex.ToString, "Data Error", MessageBoxButto ns.OK, MessageBoxIcon. Error)boolServe rsLoaded = FalseslDBList.T ext = ""FinallyMe.Cur sor = Cursors.ArrowEn d Try
Jun 27 '08
32 1707
Armin,
To write something more, maybe you remember that I 5 years ago wrote a
message just to prettend that somebody could told that he got the advice
from somebody in the newsgroups, while the result of that could be go wrong.
That was the only reason of my message.
Cor
"Cor Ligthert[MVP]" <no************ @planet.nlschre ef in bericht
news:64******** *************** ***********@mic rosoft.com...
Yes
"Armin Zingler" <az*******@free net.deschreef in bericht
news:%2******** **********@TK2M SFTNGP06.phx.gb l...
>"Cor Ligthert[MVP]" <no************ @planet.nlschri eb
>>Joergen,
Be aware that you never should do what you advice as it is a critical process that has to be completed, and the user can end that in the middle without knowing what is the effect.
Think by instance in a paying process by banks, were steps have to be done, I would never be the one who would give an advice as yours.
Just my idea,
Cor
Like Joergen, I don't understand this plea. Using another thread to avoid the UI thread being blocked is the (only) right action, IMO. But maybe you meant that the UI thread also have to be in an appropriate state depending on the whole situation, where I would agree.
Armin
That was the only reason of my message.
Ok
:-)
Armin
If DoEvents should not be used any more, why is it in the language?
Legacy code support.
That's the quickest way to get a control updated. Works just fine. This
is the first I have heard about it not being valid any longer. Does
Microsoft know about this?
Just as GoTo is the quickest way, in terms of code, to branch to another
part of your sub or function. It's still included even in VB 2008.
I wouldn't recommend using it, anymore than I'd recommend using DoEvents
though ;-) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: PontiMax |
last post by:
Hi,
when I press the OK button of my dialog box a long-running task is
initiated. Therefore I would like to make visible a div section right after
clicking the button where a user-friendly message is displayed...
How can this be done? Can I make the section visible via server-side code?
Via Response.Write()?
Any examples would be appreciated!
|
by: Larry Herbinaux |
last post by:
I'm having issues with garbage collection with my long-standing service
process. If you could review and point me in the right direction it would be
of great help. If there are any helpful documents that you could point me to
help me control the GC, then that would be great also.
The .Net GC does not cleanup memory of our service process unless it is
forced to by another process that hogs memory.
· GC Algorithm - This is an issue...
|
by: ImSoLost |
last post by:
I'm running a really long process from ASP.NET and need some help...
I am making a method call when the user presses a button from my webpage,
which goes into a database and parses a file. This process could exceed an
hour, so the user is expected to press the button to start the process and
minimize the IE window and do other work while the application is processing.
Anyway, after a certain period in time, the page becomes "Page could...
|
by: Anonieko |
last post by:
Query: How to display progress bar for long running page
Answer:
Yet another solution. REFERENCE:
http://www.eggheadcafe.com/articles/20050108.asp
My only regret is that when click the browser back button, it loads the
progress bar again.
Any solution to this?
|
by: lmttag |
last post by:
Hello.
We're developing an ASP.NET 2.0 (C#) application and we're trying to
AJAX-enable it. We're having problem with a page not showing the page while
a long-running process is executing. So, we're looking for a way to display
the page with a "please wait..." message while the process is running, and
then, when the process is done, update the page with the actual results/page
content.
We have a page that opens another browser/page...
| |
by: walterbyrd |
last post by:
I understand that Python has them, but PHP doesn't.
I think that is because mod_php is built into apache, but mod_python
is not usually in apache. If mod_python was built into apache, would
python still have long running processes (LRP)?
Do LRPs have to do with a Python interpreter running all the time? Or
is it something else?
I also understand that LRPs are the reason that shared hosting is less
|
by: commander_coder |
last post by:
Hello,
I write a lot of CGI scripts, in Python of course. Now I need to
convert some to long-running processes. I'm having trouble finding
resources about the best practices to do that.
I've found a lot of email discussions that say something like, "You
need to educate yourself about the differences when you have long-
running processes" but I've not had a lot of luck with finding things
that explain the differences. I've seen some...
|
by: =?Utf-8?B?QWxwaGFwYWdl?= |
last post by:
Hello,
I have a class MyWorker.
Each time I create a new instance of MyWorker, I queue it to the ThreadPool.
So, 1 MyWorker object is pooled and belongs to its thread (there can't have 2
MyWorker in 1 thread from the ThreadPool).
When MyWorker is initialized or instanciate, I use an asynchronous delegate
to execute a long running process (depending on users, the job can be
quicker). So, this async delegate will use or create a new...
|
by: =?Utf-8?B?d2R1ZGVr?= |
last post by:
I have a website using windows integrated security, with anonymous access
turned off. The site is used to query orders from a database and when the
search takes a long time, a windows login box appears. Regardless of what
login the user enters into this, it does not accept it and the user is locked
out of the system. Our network team and myself have been unable to find out
why this is occurring, has anyone else had a similiar problem?...
|
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,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |