473,396 Members | 1,836 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,396 software developers and data experts.

Delay using a Listbox problem

Hi,

I have a function made up of several processes. After each process I
want to write the status of the provess out to a Listbox:

void MyFunc()
{
if( DoSomething1() )
{
lsOutput.Items.Add("Success 1");
}

if( DoSomething2() )
{
lsOutput.Items.Add("Success 2");
}

//And so on
}

The problem is, none of the details are displayed to the Listbox until
all the processing is finished.

Can anyone help me out?

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 1169
Hi, Steven

if process runs in same thread, for example, UI, you have to allow message
pump to route appropriate messages including Paint to corresponding
controls. This means that somewhere in the process code you must have
DoEvents call. Even this won't guarantee timely updates. It is generally
recommended to perform long running processes in separate threads or
asynchronously to keep UI thread responsive.

You might want to check for example
http://msdn.microsoft.com/msdnmag/is...Multithreading for
recommended approaches.

HTH
Alex

"Steven Blair" <st**********@btinternet.com> wrote in message
news:er******************@tk2msftngp13.phx.gbl...
Hi,

I have a function made up of several processes. After each process I
want to write the status of the provess out to a Listbox:

void MyFunc()
{
if( DoSomething1() )
{
lsOutput.Items.Add("Success 1");
}

if( DoSomething2() )
{
lsOutput.Items.Add("Success 2");
}

//And so on
}

The problem is, none of the details are displayed to the Listbox until
all the processing is finished.

Can anyone help me out?

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Des L. Davis | last post by:
System: Dell PowerEdge Server with 3 GB RAM, 2.4 GHz Celeron Software: Microsoft SQL Server 2000 Enterprise running on Windows 2003 Server Software: Microsoft SQL Server 2000 Enterprise running on...
9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
2
by: Islamegy | last post by:
Some of my win forms was delay couple of seconds when loaded for first time.. i thought there is a problem with the sqlconnection or database but the adapter make no problem when bind to grid?! ...
3
by: Rubble | last post by:
Hello, Ive placed a server control button on my aspx page. Ive created some client side script that Ive tied to the onclick action of this button. The script adds to a listbox the contents of a...
7
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have...
12
by: wizard04 | last post by:
I have a drop-down list, populated from a database, a few text boxes, and a few buttons on a page. The ddl is set to autopostback. For some reason, whenever a postback happens (when an item in...
3
by: Sirix42 | last post by:
Hi there, when I use Firefox to run my application (this involves sending an IFRAME request to the servlet and handling the response), there is no delay in displaying the data after each response....
4
by: =?Utf-8?B?RGFpc3k=?= | last post by:
I have a couple of listboxes and dropdownlist on a page and they are postback enabled. The problem is whenever user clicks the box the page brings to the top. is there anyway to delay the postback...
6
by: sheldonlg | last post by:
I came across a problem and googling for an answer didn't help. What I want to do is run an AJAX script that sets a hidden variable on the form. I call the AJAX script from a javascript...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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
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.