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 / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KR - 20 Apr 2006 15:01 GMT
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

Signature

The enclosed questions or comments are entirely mine and don't represent the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.

Daniel Moth - 20 Apr 2006 15:12 GMT
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/microsoft.public.dotnet.framework.compactframewor
k/search?group=microsoft.public.dotnet.framework.compactframework&q=cerunappatev
ent


Cheers
Daniel
--
http://www.danielmoth.com/Blog/

>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
[quoted text clipped - 14 lines]
> Thanks,
> Keith
KR - 20 Apr 2006 19:15 GMT
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

> 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
[quoted text clipped - 4 lines]
> Also see these previous threads on executing code at certain events, in case
> it is relevant to you:

http://groups.google.com/group/microsoft.public.dotnet.framework.compactframewor
k/search?group=microsoft.public.dotnet.framework.compactframework&q=cerunappatev
ent


> Cheers
> Daniel
[quoted text clipped - 19 lines]
> > Thanks,
> > Keith

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.