The problem is that you include your timer in a second thread, and that thread has no message pump.
Windows SetTimer. , API SetTimer. WM_TIMER , . Tick.
, , WM_TIMER . , , , WM_TIMER , . , , this , , ( , ) :
public byte[] ReadAllBytesFromStream(Stream input)
{
if(this.InvokeRequired)
{
this.Invoke(new MethodInvoker(clock.Start));
}
else
{
clock.Start();
}
using (...)
{
while (some conditions)
{
...
(int-->) ByteCount = aValue;
...
}
return .... ;
}
}
private void clock_Tick(object sender, EventArgs e)
{
this.label6.Text = ByteCount.ToString() + " B/s";
}