Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

Problem with a timer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kenny M. - 20 Jan 2005 21:27 GMT
I have a Winform running and a timer (winform) firing each 3 min to make a
transmition of data..I'm ok about the UI stoping for a while, the problems is
that the timer fires two times in every interval, even if I use time.Stop.

It seems that the stop instruction is not stoping the timer associated counter

Private Sub TimerTransmite_Tick(....)
TimerTrans.Stop()
  Transfer()
TimerTrans.Start()
End

Any Sug?
TCORDON - 20 Jan 2005 21:59 GMT
If the timer has the interval you want why would you want to stop and start
it every time?

As for the UI stoping, have you considered running Transfer() on a different
thread? You could have Trasnfer() Start the timer when it finishes and you
UI would not stop.

Regards,

>I have a Winform running and a timer (winform) firing each 3 min to make a
> transmition of data..I'm ok about the UI stoping for a while, the problems
[quoted text clipped - 11 lines]
>
> Any Sug?
Kenny M. - 20 Jan 2005 22:43 GMT
hi

well, I'm stoping the timer because in the transfer procedure I'm sending
critical information (money) as a long string to a WebService (sincronous) so
I dont want to the timer overlaps the previous Tick event if the webservice
take to long to return.

To be honest, I was playing aroung with Asinc WS and the result was my Data
being duplicated when I sent it to the server, so I'm a little bit frustated
with Async ws

> If the timer has the interval you want why would you want to stop and start
> it every time?
[quoted text clipped - 20 lines]
> >
> > Any Sug?
Herfried K. Wagner [MVP] - 20 Jan 2005 23:00 GMT
"Kenny M." <KennyM@discussions.microsoft.com> schrieb:
>I have a Winform running and a timer (winform) firing each 3 min to make a
> transmition of data..I'm ok about the UI stoping for a while, the problems
> is
> that the timer fires two times in every interval, even if I use time.Stop.

What type of timer are you using?  Are you sure you are using a
'System.Windows.Forms.Timer'?

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>

Kenny M. - 21 Jan 2005 00:39 GMT
yeap I'm Sure it is a Windows.forms.Timer that I Drag from the toolbox

it is pretty simple to see what I said. just set an interval (60000) and set
a breakpoint on transfer and you will see that after the breakpoint stop and
press F5 inmediatly the Breakpoint is fired again

Private Sub TimerTrans_Tick(....)
   TimerTrans.Stop()
   Transfer()
   TimerTrans.Start()
End

thks

> "Kenny M." <KennyM@discussions.microsoft.com> schrieb:
> >I have a Winform running and a timer (winform) firing each 3 min to make a
[quoted text clipped - 4 lines]
> What type of timer are you using?  Are you sure you are using a
> 'System.Windows.Forms.Timer'?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.