Hi,
I have a Label on a Windows form (Version 1.1.4322) and while I iterate
recursively through a method I want to show the name of the current file
being copied to another directory.
The Label is not visible until the backup begins, at which point I resize
the form to show the Label and a ProgressBar. As each file is copied, the
Label is updated:
foreach(FileInf o file in dir.GetFiles())
{
file.CopyTo(ful lpath + "\\" + file.Name);
lblFileName.Tex t = "Copying file " + file.FullName;
}
There is other code in this loop but not relevant (increment the
progressbar, decrement a counter for the remaining files, things like that).
The problem I have is that nothing appears in the Label.
I set the Label's Visible property to false in the Load event handler, and
only set it to true after I have resized the form during the backup. Once
the backup is complete, I set visible to false again and reset the form to
it's original size.
I even tried setting it to false in the designer and put some dummy text in
to see what it showed. The dummy text didn't appear. The text appeared when
I set visible to true in the designer, but it didn't change.
Stepping through the code, the Label is definitely showing as visible and
the text reflects the current file name, but it refuses to show this on the
form.
Does anyone have any ideas?