PC Review


Reply
Thread Tools Rate Thread

DateTimePicker formatting

 
 
Sumit
Guest
Posts: n/a
 
      8th Feb 2005
Hi All

I am using DateTimePicker Control in my application.
On form Load i want to set the value in the DateTimePicker to nearest
coming Sunday.

Can anyone suggest me how to do it ????

Warm Regards
Sumit

 
Reply With Quote
 
 
 
 
Mohamoss
Guest
Posts: n/a
 
      8th Feb 2005
Hi Sumit
Check out this sample extended DataTimePicker
http://www.thecodeproject.com/cs/mis...timepicker.asp

Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      8th Feb 2005
Sumit,

Is that not simpel using the dayofweek property of datetime and with the
datetime.adddays(the days to go)?

http://msdn.microsoft.com/library/de...classtopic.asp

http://msdn.microsoft.com/library/de...fweektopic.asp

Cor


 
Reply With Quote
 
CSharper
Guest
Posts: n/a
 
      28th Apr 2005
Agreed. It's crude, but this should work.

DateTime dt = DateTime.Today;
while (dt.DayOfWeek != DayOfWeek.Sunday){
dt.AddDays(1);
}
dtp.Value = dt;

Hope this helps,

Dan Cox

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sumit,
>
> Is that not simpel using the dayofweek property of datetime and with the
> datetime.adddays(the days to go)?
>
> http://msdn.microsoft.com/library/de...classtopic.asp
>
> http://msdn.microsoft.com/library/de...fweektopic.asp
>
> Cor
>
>





 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
datetimepicker Toren Valone Microsoft C# .NET 2 30th Jun 2008 09:22 PM
DateTimePicker =?Utf-8?B?bmJvaGFuYQ==?= Microsoft C# .NET 0 7th Jun 2005 05:38 AM
DateTimePicker Saurabh Microsoft Dot NET Framework Forms 3 26th May 2004 10:11 AM
DateTimePicker Atley Microsoft VB .NET 2 27th Feb 2004 04:38 PM
datetimepicker Erald Kulk Microsoft C# .NET 2 13th Oct 2003 01:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:59 AM.