473,396 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DateTimePicker - A date or a time, how to do both?

I'm using the date/time picker to allow users to choose a date or a time.
However, as the control modes only allow one or the other, I'm scratching my
head as to how to allow the one control to allow both a date and a time
selection. Should I place 2 controls next to each other? I'm having
trouble with screen real-estate. Perhaps there is a single control that
will allow this?

Thanks
Robin
Nov 21 '05 #1
2 1337
Ok sorry people, worked out how to use a custom format :)

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:cu******************@news.demon.co.uk...
I'm using the date/time picker to allow users to choose a date or a time.
However, as the control modes only allow one or the other, I'm scratching
my head as to how to allow the one control to allow both a date and a time
selection. Should I place 2 controls next to each other? I'm having
trouble with screen real-estate. Perhaps there is a single control that
will allow this?

Thanks
Robin

Nov 21 '05 #2
Robin,

"Robin Tucker" <id*************************@reallyidont.com> schrieb:
I'm using the date/time picker to allow users to choose a date or a time.
However, as the control modes only allow one or the other, I'm scratching
my head as to how to allow the one control to allow both a date and a time
selection-


Set the datetimepicker's 'Format' property to 'Custom' and assign a custom
format to its 'CustomFormat' property.

..NET Framework Developer's Guide -- Standard DateTime Format Strings
<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconstandarddatetimeformatstrings.asp>

..NET Framework Developer's Guide -- Custom DateTime Format Strings
<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomdatetimeformatstrings.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
4
by: Jacek Jurkowski | last post by:
.... the minimum date of DateTimePicker is 1753-01-01. How to make DateTime to do not show nothing in its text if this date is the value? I have a form with a field LastLogonDate. If user hasn't...
7
by: Edward Mitchell | last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a format of Time. The controls are all embedded in dialogs. I created the controls by dragging the DateTime picker from...
3
by: Mike Fellows | last post by:
I want to use a datetimepicker to selct both Date and Time - but i cant find out how to let me select both it seems to me that it is either one or the other. If this is the case what can i use...
0
by: thull | last post by:
I'm trying to modify an older VB6 program and use the DateTimePicker control to give the user the ability to display and modify the system date and time. The VB6 documentation says it is available...
6
by: Kyote | last post by:
I'm using a DateTimePicker for date fields in an Access db Membership app. Some of the date fields are empty, meaning they haven't been filled out yet, or they cannot be. But when a record is read...
5
by: Mike | last post by:
Hi, I use MS SQL Express and VS 2005 c#, win application. I would like to select value rom DateTimePicker and list all values for selected date within GridView. I have method as follows: ...
0
by: tschroeder250 | last post by:
Hi Everyone, There are so many Nullable DateTimePickers out there that this post may not even be found among all the others, but I wanted to try. First, I want to thank all the authors of the...
11
by: jessy | last post by:
Hi, I have a problem with my DateTimePicker javascript code which i downloaded , the problem is when i pick the date and the date appears in my Text Field and i click Submit the date which i picked...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.