A few things.
First, when you post code here, please post the real code.
Cut-and-paste the relevant bits of code directly from your project into
your post. You'll get a much better response from people because your
post will be clearer. For example, I notice that you also typed the
..Text property as .text, which won't work in C#.
Second, I have a theory (although I can't tell for sure because I can't
see all of your code). You do realize that when you say:
nsInterface.frmInterface objTemp = new nsInterface.frmInterface();
that you are creating a brand new form, that has nothing to do with any
other frmInterface that may be showing on the screen? Let me
illustrate. Let's say that you say:
nsInterface.frmInterface inter1 = new nsInterface.frmInterface();
inter1.Show();
and then somewhere else in your code you say:
nsInterface.frmInterface objTemp = new nsInterface.frmInterface();
objTemp.lblStatus.Text = "etc. etc.";
that this will do _absolutely nothing_ to the form that's showing on
the screen (that has a reference stored in "inter1"). By saying "new"
twice you're creating _two_ forms and then changing the label text on
the second one. This does nothing to the first one. That's what Kevin
was talking about when he said that you had to have a reference to the
form instance. In the code above I created _two_ instances of the same
form. If I had said
objTemp.Show();
then I would see two identical forms on the screen (except one would
have its label text set to "etc. etc.").
Third, realize that updates to the user interface occur only after the
UI thread has finished all of its processing. If you're in the middle
of some code and you say
objTemp.lblStatus.Text = "etc. etc.";
the label text doesn't change right away. Instead, WinForms marks the
label as "dirty" and needing to be redrawn. Then, when the UI thread
returns to Windows, WinForms then walks through the form looking for
stuff to redraw. This is why having a "status label" doesn't show
progress if you're doing all of your processing in the UI thread. If
you run the following code under the UI thread
for (int i = 0; i < 10000; i++)
{
objTemp.lblStatus.Text = String.Format("Processing {0} of
10000...", i);
}
objTemp.lblStatus.Text = "Done.";
all you'll see in the label, after a brief pause, is "Done.". That's
because WinForms marked lblStatus as "dirty", but only actually redrew
it on the screen after you'd finished your work in the UI thread, at
which point its text reads "Done."
Fourth, and finally, it's generally bad form to expose child controls
to the outside world. You should prefer to write a property in your
frmInterface class that looks like this:
public string StatusString
{
get { return this.lblStatus.Text; }
set { this.lblStatus.Text = value; }
}
and then make lblStatus private. That way you can one day decide to
change your status display from a label to some other control without
breaking all of your client code.