I am having the same sort of issue:
I have set up a class that handles my TcpClient communications. I pass it a
reference to a Label. I then want to dynamically update this Label with
status information. Nothing happens. I have tried all sorts of calls to cause
the Label to “redraw” to no avail. Here is a little snippet:
char[] seps = {' '};
string[] values = response.Split(seps);
retval.Add(values[0]);
extLbl.Select();
extLbl.Focus();
extLbl.Text=values[0];
extLbl.Update();
extLbl.BringToFront();
newsgroupForm.Update();
bval=extLbl.InvokeRequired;
bval=extLbl.IsAccessible;
extLbl.Invalidate();
extLbl.Refresh();
Needless to say, I have thrown everything in except the kitchen sink, and
the Label still refuses to update.
So what do I do now???
"Nicholas Paldino [.NET/C# MVP]" wrote:
Ole,
I would think that you just pass a reference to each of the forms to the
class. Unless you derive all the forms from a base class which helps to
define the user interface elements in a more coherent manner, you will have
to access the controls through the Controls collection.
Or is there something I'm missing?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"ORC" <or*@sol.dk> wrote in message
news:ey**************@TK2MSFTNGP14.phx.gbl... Hi,
I have an application that has 7 forms. I would like to update the
controls
on the forms from a single class. How should I do that if possible? The
reason for this is that my application is made for both full- and compact
framework and all the code except the forms is the same.
Thanks
Ole