Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Windows form timer in State.Dataloaded

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Windows form timer in State.Dataloaded

    Hi,

    I was starting a timer with a code sample per below in State.Configure. It worked fine. I noticed some of the references examples (for example TriggerCustomEvent) show a timer being started/configured in State.DataLoaded instead. This also made a little more sense for my purpose, so I did the same. Same code. Just moved it to State.Dataloaded. The issue is that, although that code runs and the print verifies the timer was enabled, the timer never runs. If I move the same code block back up to State.Configure, it works fine again.

    Curious as to what the reason for this is?

    Code sample
    Code:
    // Adds the event and the event handler for the meth od that will
    // process the timer event to the timer.
    
    myTimer.Tick += new EventHandl er(TimerEventProcessor);
    // Sets the timer interval to X milliseconds.
    myTimer.Interval = 500; // ms
    myTimer.Enabled = true;
    //myTimer.Start();
    PPrint("BA Timer started with " + myTimer.Interval.ToString() +"ms");

    #2
    Hello pjsmith,

    The timer you are using should be replaced with System.Timers.Timer.
    The windows forms timer would no longer be used as NT8 now uses WPF, the WPF timers would be more appropriate to be used. Could you try the sample from the help guide in regard to the timers type and how its configured and see if you still have problems?



    I look forward to being of further assistance.

    Comment


      #3
      Hi - Good point, and that does, in fact, work fine moved into DataLoaded. Thank you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X