Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Display 'MM/DD/YYYY' in DTPicker


Message #1 by "Senthil Kumar" <jsenthil_kumar@h...> on Fri, 14 Mar 2003 06:06:32
Hello Senthil....

I think following trick will solve your problem.

When ever you want to display DD/MM/YYYY in 
Date Picker, just make its CustomFormat
as 'DD/MM/YYYY' .

Please do not avoid single quotes.

Please see the help associated with 
CustomFormat of Date Picker, in MSDN, 
for more details.

I already tested this .For this 
create a form with a Date Picker
and two Command Buttons.
Name Date Picker as dtpTest
Name one of the Command Button as cmdDate
Name other Command Button as cmdDMY
*Make Property-Format of Date Picker as 3-dtpCustom

Copy the following Code
'''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit

Private Sub cmdDate_Click()
dtpTest.CustomFormat = "dd/MM/yyy"
dtpTest.Value = Now
End Sub

Private Sub cmdDMY_Click()
dtpTest.CustomFormat = "'DD/MM/YYYY'"
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''
Click cmdDate to display today's Date
Click cmdDMY to 
Regards

Ginish
-------------------------------------------------


> Hi Guys

>  Am having trouble displaying 'MM/DD/YYYY' in DTPicker. If the date is 
e> mpty in the table it should display 'MM/DD/YYYY' else the actual date. 
E> ven after setting the property to 'dtpCustom' it won't 
d> isplay 'MM/DD/YYYY'. Can you guys suggest me a solution please?

> Thanks
S> enthil

  Return to Index