Need help in DateTimePicker
-
Hi friends.. I need to show date and time both at a time in the DateTimePicker right now i have seen all examples of DateTimePicker show to disply only date r only time at a time. can some one help me how to show date and time both at a time in DateTimePicker. please let me know if it can be done? thank u in advance
-
Hi friends.. I need to show date and time both at a time in the DateTimePicker right now i have seen all examples of DateTimePicker show to disply only date r only time at a time. can some one help me how to show date and time both at a time in DateTimePicker. please let me know if it can be done? thank u in advance
-
You can set custom format using SetFormat() e.g. from msdn
CString formatStr= _T("'Today is: 'yy'/'MM'/'dd");
m_dtPicker.SetFormat(formatStr);I hope it helps.
Regards, Sandip.
-
thats really nice idea. and also is there any way that i can show date calender for date and spin control for for time at a time in the UI? i need to show calender for date and spin control for time at a time will that be possible? please let me know
sarat12in wrote:
will that be possible?
Yes, if you use the
DTS_TIMEFORMAT
style."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
sarat12in wrote:
will that be possible?
Yes, if you use the
DTS_TIMEFORMAT
style."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
DTS_TIMEFORMAT will only shows the time but not date calender i need to show date calender and time spin control any suggestion please thank you
i will go with the first suggestion. but the problem in here is.. if i mention date time format programatically with setFormat , then the display format wont get changed depends on locale its a big problem for me. is there any way that i can get the system format fist and pass it as a string to SetFormat? r is there any other way to handle this scenario? Thanx in advance
-
DTS_TIMEFORMAT will only shows the time but not date calender i need to show date calender and time spin control any suggestion please thank you
If you want both the date and time in the same control, you'll need to use a format string rather than one of the preset formats. See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
i will go with the first suggestion. but the problem in here is.. if i mention date time format programatically with setFormat , then the display format wont get changed depends on locale its a big problem for me. is there any way that i can get the system format fist and pass it as a string to SetFormat? r is there any other way to handle this scenario? Thanx in advance
sarat12in wrote:
is there any way that i can get the system format fist and pass it as a string to SetFormat?
Yes. Use
GetDateFormat()
andGetTimeFormat()
."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch