Solved

DateTime Picker

Posted on 2001-07-29
5
446 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding to a VBA? 6 61
Recommendation vb6 to vb.net or others 14 109
vbModal 12 34
Advice in Xamarin 21 52
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

912 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

16 Experts available now in Live!

Get 1:1 Help Now