You have to explain your problem better by showing a code sample.
Even though I don't understand what issue you are facing here are two common
*mistakes* devs make when it comes to timers:
1. Specify a small interval for the timer. In a NETCF app anything under a
second for a Windows.Forms.Timer and you really have to question the reasons
behind it.
2. Leave the timer running without coding for reentrant conditions. In other
words, what you should be doing is starting your timer, stopping it when it
fires and then restarting it if you have to at the end of the timer_tick
handling code.
Cheers
Daniel
--
http://www.danielmoth.com/Blog/
> I have a timer and a few sequent function inside it. Functions are called
> in a "For ..Each" code block.Program does not response any request that
[quoted text clipped - 5 lines]
> be nice..
> Thanx in advance..
Here some code from my code ( timer is form timer).I added explanations of
my problem inside code.
Thanx in advance.
Private Sub timerTank_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles timerTank.Tick
'Application.DoEvents() works here but whern i use it inside FOR as below
program stops.
Application.DoEvents()
For counter = 0 To hashTableTank.Count - 1
'Here is the code (Just inside for) where i want to use Application.DoEvents
becuase when code runs here , form does not response requests.
If portSettings() AndAlso portOpen() Then
Select Case Trim(currentTankControl.probeType)
Case "Cylindir"
CalculateCylindir()
Case "Rectangle"
CalcuateRectangle()
End Select
Else
MsgBox("Check Comm Ports.")
Exit Sub
End If
Next
End Sub
Note: CalculateCylindir() & CalcuateRectangle() methods have a few
sleep like ( System.Threading.Thread.Sleep( 100 ) ) inside them.

Signature
Hakan Aktan
Software Developer
"Daniel Moth" <dmoth74@hotmail.com>, haber iletisinde þunlarý
yazdý:%23qVwe8cVGHA.5900@tk2msftngp13.phx.gbl...
> You have to explain your problem better by showing a code sample.
>
[quoted text clipped - 11 lines]
> Daniel
> --
Daniel Moth - 03 Apr 2006 09:15 GMT
So you are not addressing the two concerns I raised.
1. What is the interval of the timer?
2. I don't see you disabling the timer in timerTank_Tick (and if necessary
re-enabling it on exit)
Once you've done the second and verified that the answer to the first is
>1000 then we can proceed.
FYI, there are very few cases where DoEvents is justified and it is
sometimes an indication of code requiring worker threads (or some wrapper
like BackgroundWorker). This will certainly be the case here if your two
calculate methods are long running (which, btw, shouldn't have Sleep in them
since you are calling them on the UI thread)
Cheers
Daniel
--
http://www.danielmoth.com/Blog/
> Here some code from my code ( timer is form timer).I added explanations of
> my problem inside code.
[quoted text clipped - 58 lines]
>> Daniel
>> --
<ctacke/> - 03 Apr 2006 14:00 GMT
Sure, the behavior you describe is expected. The Forms.Timer handler runs
in the UI thread context. While it's running, the UI won't service other
stuff, so it will appear locked. Use a Threading.Timer.
-Chris
> Here some code from my code ( timer is form timer).I added explanations of
> my problem inside code.
[quoted text clipped - 58 lines]
>> Daniel
>> --
Dick Grier - 03 Apr 2006 18:32 GMT
It is seldom a good idea to call Application.DoEvents (though there are
exceptions). You often can use a worker thread instead, and achieve better
performance. I suggest threading only when needed, but if your loop takes
seconds to run, then it may be a good idea. However, if the loop completes
in a couple hundred mS, then don't bother... And, don't bother with
Application.DoEvents.

Signature
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.