Форум: "Основная";
Текущий архив: 2003.01.30;
Скачать: [xml.tar.bz2];
ВнизЛюди как в DateTimePicker установить Найти похожие ветки
← →
Kurt_ (2003-01-19 12:03) [0]Люди как в DateTimePicker установить "короткий" формат даты? только именно в компоненте в свойствах как:-) а не в настрой ках времени на компьютере.
Заранее благодарен!
← →
Романов Р.В. (2003-01-19 12:08) [1]F1 - TDateTimePicker.DateFormat
← →
Kurt_ (2003-01-19 12:20) [2]я имел ввиду 2 или 4 цифры в годе. то есть "короткий" это 19.01.03 а "длинный" 19.01.2003
← →
Романов Р.В. (2003-01-19 12:28) [3]Изменяй глобальную переменную ShortDateFormat
← →
Kurt_ (2003-01-19 12:47) [4]спасибо. только оно срабатывает когда ты вводишь, а так визуально все "длинный" выводит. и на DateTimePicker не действует эта переменная:-/
← →
asmith (2003-01-19 13:45) [5]Для этого контрола формат задается посылкой сообщения DTM_SETFORMAT, подробности в MSDN
← →
Kurt_ (2003-01-19 22:24) [6]MSDN, не под рукой. не подскажешь в примере, плиз!
← →
asmith (2003-01-20 13:41) [7]DTM_SETFORMAT
wParam = 0;
lParam = (LPARAM) lpszFormat;
Parameters
lpszFormat
Address of a zero-terminated format string that defines the desired display. Setting this parameter to NULL will reset the control to the default format string for the current style.
Return Values
Returns nonzero if successful, or zero otherwise.
Preset Formats
There are three preset formats available for displaying the date and one for displaying time. Set these formats by choosing one of the following window styles:
DTS_LONGDATEFORMAT
The display will look like: "Friday, April 19, 1996".
DTS_SHORTDATEFORMAT
The display will look like: "4/19/96".
DTS_SHORTDATECENTURYFORMAT
Version 5.80. The display will look like: "4/19/1996".
DTS_TIMEFORMAT
The display will look like: "5:31:42 PM".
Custom formats
A DTP control relies on a format string to determine how it will display fields of information. If the preset formats are not sufficient, you can create a custom format by defining your own format string. Custom formats provide greater flexibility for an application. They enable you to specify the order in which the control will display fields of information. You can include body text as well as callback fields for requesting information from the user. Once the string is created, you assign it to the DTP control with a DTM_SETFORMAT message.
Format Strings
A DTP format string consists of a series of elements that represent a particular piece of information and define its display format. The elements will be displayed in the order they appear in the format string.
Date and time format elements will be replaced by the actual date and time. They are defined by the following groups of characters:
Element Description
"d" The one- or two-digit day.
"dd" The two-digit day. Single-digit day values are preceded by a zero.
"ddd" The three-character weekday abbreviation.
"dddd" The full weekday name.
"h" The one- or two-digit hour in 12-hour format.
"hh" The two-digit hour in 12-hour format. Single-digit values are preceded by a zero.
"H" The one- or two-digit hour in 24-hour format.
"HH" The two-digit hour in 24-hour format. Single-digit values are preceded by a zero.
"m" The one- or two-digit minute.
"mm" The two-digit minute. Single-digit values are preceded by a zero.
"M" The one- or two-digit month number.
"MM" The two-digit month number. Single-digit values are preceded by a zero.
"MMM" The three-character month abbreviation.
"MMMM" The full month name.
"t" The one-letter AM/PM abbreviation (that is, AM is displayed as "A").
"tt" The two-letter AM/PM abbreviation (that is, AM is displayed as "AM").
"yy" The last two digits of the year (that is, 1996 would be displayed as "96").
"yyyy" The full year (that is, 1996 would be displayed as "1996").
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2003.01.30;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.008 c