473,395 Members | 1,629 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,395 software developers and data experts.

How to set DateTimePicker only edit time ?

How to set DateTimePicker only edit time ?

There is a DateTimePicker whoes Format = Time.

I find it only displys as time edit, but in fact, this control still control
Full DateTime when you click the button.

I mean if I enter 08:12:00, I want to get 08:12:00 only, not 1998-12-01
08:12:00.

How can I do that ?

Thanks

Charles shao

Nov 17 '05 #1
1 22877
On Thu, 31 Mar 2005 10:18:37 +0800, cyshao wrote:
How to set DateTimePicker only edit time ?

There is a DateTimePicker whoes Format = Time.

I find it only displys as time edit, but in fact, this control still control
Full DateTime when you click the button.

I mean if I enter 08:12:00, I want to get 08:12:00 only, not 1998-12-01
08:12:00.

How can I do that ?


Change the ShowUpDown property to true to prevent the drop calendar from
being displayed. The value that you get out of it will still be a DateTime
object, but you can get only the time portion of that easy enough if that
is all you want. Use one of the members on the DateTime object that gets
just the time (ToShortTimeString(), ToLongTimeString(), TimeOfDay, Hour,
Minute, Second, etc).
--
Tom Porterfield
Nov 17 '05 #2

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...
1
by: Karl | last post by:
Hi, .Net experts, I am using DatagridDateTimepickerColumn style posted on MSDN .net class document in my datagrid. You can see the datagridDateTimepickerColumn style at...
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: touf | last post by:
Hi, I've a DateTimePicker control , format dd/mm/yyyy How is it possible to always highlight the DD part when the user clic inside the control or use the TAB key to go in. This will simplify the...
2
by: andreas | last post by:
Hi, I have a datetimepicker , format set to time and two strings, the first give me a hour lke "5" and the other the minutes like "15" How can i put these two values in the datetimepicker ?...
0
by: Steve Cutting | last post by:
Hi all, I have created a form used for entry of repair details into a table on a MSDE database. I am using a datetimepicker for entry of the repair date. It is set to SHORT display format and I...
3
by: Simon Tamman | last post by:
I've come across an interesting bug. I have workarounds but i'd like to know the root of the problem. I've stripped it down into a short file and hope someone might have an idea about what's going...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.