473,407 Members | 2,312 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,407 software developers and data experts.

updating a lables text

I am looping through a number of files and I want to display the current
file name that is being processed to the form in a lable.

this.lblProcessing.Text = "Processing file: " +
this.lBxFiles.SelectedItems[ i ].ToString();

My broblem is that nothing is being display. I can do a

Console.WriteLine( this.lblProcessing.Text );

and it writes the correct file name.

Why is

this.lblProcessing.Text = "Processing file: " +
this.lBxFiles.SelectedItems[ i ].ToString();

not updating?

Is there a better way to do this?

Thanks,

Jerry
Feb 8 '07 #1
2 1372
If you are using this code inside a tight loop, then that may be why
the lable is not refreshing. One thing you can try is to add an
Application.DoEvents call within your loop.

===============
Clay Burch
Syncfusion, Inc.

Feb 8 '07 #2
Jerry wrote:
I am looping through a number of files and I want to display the current
file name that is being processed to the form in a lable.

this.lblProcessing.Text = "Processing file: " +
this.lBxFiles.SelectedItems[ i ].ToString();

My broblem is that nothing is being display. I can do a

Console.WriteLine( this.lblProcessing.Text );

and it writes the correct file name.

Why is

this.lblProcessing.Text = "Processing file: " +
this.lBxFiles.SelectedItems[ i ].ToString();

not updating?

Is there a better way to do this?

Thanks,

Jerry
Because the thread that would do the update is busy looping through
files, so it's not receiving any messages.

You can call DoEvents to handle the messages in the queue.

--
Göran Andersson
_____
http://www.guffa.com
Feb 8 '07 #3

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

Similar topics

11
by: Jason | last post by:
Hello, I would like to fill more than one lable with info in an IF then statement. I know I can do this. If radPizza.checked = true then lblsubtotal.text = FormatCurrency(mdecPizzatotal)...
1
by: nehal | last post by:
Sir, i want in my application, a form should display lables according to the data in the database means no. of lables are not decided. how can i do this ? i also want my first form should...
1
by: Jerry | last post by:
Hi again, I have two forms as controls. Both are on a main form and with a treeview I switch back and forth between the two. On the first form is a calculation. The result of this calculation...
14
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
4
by: =?Utf-8?B?T2xhbg==?= | last post by:
Hi, I'm trying to dynamically remove labels from a windows form in csharp. I have a foreach loop similar to : foreach(Control c in this.Controls) { c.Dispose(); }
0
by: =?Utf-8?B?YmFrZXJzaGFjaw==?= | last post by:
Unless my app is EXTREMELY simple, I get the cross-threading error message regularly when updating controls on a Windows form. My latest example involves a dll that runs a System.Threading.Timer,...
1
by: zivon | last post by:
hello everyone ! I'm trying to make something like a calendar I made some lables with the same names, with another number at the end of each one. eg: d1, d2, d3, d4 now I want to loop through...
4
by: donal | last post by:
I'm using MS Access; Is there an easy way to add a "0" in front of my zip codes? I am printing address lables and the "0" is not showing up? Help!
1
by: namartajhamb | last post by:
I have one Confirm Message Box using Confirm() javascript function which display two buttons Ok and Cancel. I want to Change these buttons lables into YES/NO. how can i change lables of buttons....
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
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
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
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,...

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.