Repost (I think): newbie running event at a certain time (VS2003)

  • Thread starter Thread starter KR
  • Start date Start date
K

KR

I posted this early this morning from home, but it doesn't appear the post
ever arrived, so here is attempt #2. My apologies if the earlier post
eventually arrives.

I'm an inexperienced programmer using VS2003, and I want to tweak my project
so that one commandbutton is only enabled between noon and midnight, and is
disabled between midnight and noon each day.

I have no experience with threads; do I need to learn threads to do this
properly, or is there an easier, non-resource-intensive way I can run this
based on the PPC clock?

This is targeted at some Dell Axims and maybe some Ipaq 22xx models.

Thanks,
Keith
 
You could run a Timer (Windows.Forms or Threading) and check periodically
the current DateTime and make your decision based on that (you could also
change the timer interval based on what DateTime returns). Obviously you
should also check the time just before executing the button_click code and
proceed as appropriate just to be safe.

Also see these previous threads on executing code at certain events, in case
it is relevant to you:
http://groups.google.com/group/micr....framework.compactframework&q=cerunappatevent

Cheers
Daniel
 
Actually, your last suggestion solves my problem in the most eloquent
fashion, and saves me from having to learn how to use threads just yet- I'll
simply check the time when the button is clicked, and only proceed if the
time is in the PM. <slaps forehead> ...why didn't I think of that....
:)
Thanks,
Keith
 
Back
Top