Ignacio Machin ( .NET/ C# MVP ) wrote:
On Aug 1, 10:07 am, "Big D" <BigDa...@newsgroup.nospamwrote:
>Is there a way to embed timedate.cpl into a form?
do you care to explain what is timedate.cpl?
Start a command prompt, enter "timedate.cpl" and see for yourself!
It's what English versions of Windows call "Date and Time" in the Control Panel.
To answer the OP's question: you don't want to do that. If your manager told
you to put it in, tell him some guy on Usenet thinks he's dumb for
duplicating OS functionality in a user app. It might work.
If you just want a way to *display* dates and times and have the user pick
from them, use the built-in Calendar control or one of the many third-party
alternatives. If you really want to be able to change the system time from
your application, that's the way to go too (hooking it up to a call to
SetSystemTime), but I'll say again that there's not much point in trying to
one-up Windows.
Even if it's possible to make Date and Time appear in your window, it'll be
a nasty hack. What happens when the next release of Windows doesn't ship
with a Date and Time control where your nasty hack works? Do you really want
to be the one maintaining that?
You can always have Date and Time display on its own by ShellExecute'ing
timedate.cpl (that's the Process class in .NET), but even that is iffy. Just
let the people who's business it is to change the system time call it up
themselves when needed. It shouldn't be a common task.
--
J.