Solved

DateTime Picker

Posted on 2001-07-29
5
443 Views
Last Modified: 2008-02-01
Hi,

I'm using the Date/Time Picker control and I would like to eliminate the strange spacing that seems to occur in the display of the date.  I'm using the short date format as follows.

The date should display like this in the DTPicker:
1/7/01

But instead display's like this:
1 /7 /01

This forces the control to be larger than it should be, taking up extra space and it looks just plain goofy compared to the rest of the neatly formatted info in the window.

I've noticed that Microsoft seems to have avoided this problem in the Date section of the Find tool...As in Start -> Find -> File or Folders...It displays the short date just fine and without the goofy spacing.

Any ideas on how to get rid of the extra spaces would be appreciated.  Please note that I've tried using custom format with a M/d/yy variation without success.

Thanks,

Jim
0
Comment
Question by:syntel
5 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 200 total points
ID: 6333029
Hi syntel,

Try to set the CustomFormat Property in Data/Time Picker control.

Set the Format Property to 3 - dtpCustom,

then

Set the CustomFormat Property as dd/mm/yyyy

'Hope this will solve your problem, regards.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6333442
Neither the standard control nor the CCRP version of this control seem to have the ability to remove these spaces. Unless you choose a date format that fills the gaps such as suggested by ryancys (though this is more easily selected using  .Format = dtpShortDate) you have to live with the extra spacing.

I would either stick with the standard short date format (check what you have for this under control panel settings though) or go with CustomFormat = "dd/MM/yyyy"

0
 

Author Comment

by:syntel
ID: 6336313
Ineresting that Microsoft seems to get the control to work without the spacing.  I'd like to think there's another option.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7161657
Hi syntel,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept ryancys's comment(s) as an answer.

syntel, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7182450
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now