|
|
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
Мне нужно на Access'овской форме разместить поле типа Дата с всплывающим календарем типа как в дельфи DateTimePicker. Подскажите плиз ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 12:18:54 |
|
||
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
поиск по форуму. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 12:19:56 |
|
||
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
Спасибо Но, я нашел только это /topic/29834&hl=datetimepicker а там не написано как положить контрол на форму. У меня в тул баре нет такого контрола. Кнорка "Другие элементы" выводит огромный список, ничего подходящего я не нашел. Подскажите, пожалуйста! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 12:32:03 |
|
||
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
Public Sub CreateDTPControl() Dim udtICC As INITCOMMONCONTROLSEXSTRUCT Dim lngStyle As Long Dim hInstance As Long Dim lngRet As Long Dim udtRECT As RECT 'Position of the Command Button Dim lngIC As Long Dim lngYdpi As Long Dim lngTempRight As Long Dim lngTempBottom As Long Dim lngPrevStyle As Long ' Courtesy of Ken Getz hInstance = apiGetWindowLong(Application.hWndAccessApp, GWL_HINSTANCE) udtICC.dwsize = Len(udtICC) udtICC.dwICC = ICC_DATE_CLASSES Call apiInitCommonControlsEx(udtICC) lngStyle = WS_BORDER Or WS_CHILD Or WS_VISIBLE 'Or m_DateFormat 'DTS_SHORTDATEFORMAT hWndDTP = apiCreateWindowEx(0&, _ "SysMonthCal32", _ "DateTimePicker", _ lngStyle, _ 30, _ 30, _ 250, _ 250, _ Me.hWnd, _ 0&, _ hInstance, _ ByVal 0&) 'If the Selected date is allready set make that selection Dim udtST As SYSTEMTIME If Not IsNull(m_SelectedDate) Then With udtST .wYear = Year(m_SelectedDate) .wMonth = Month(m_SelectedDate) .wDay = Day(m_SelectedDate) End With Call apiSendMessage(hWndDTP, MCM_SETCURSEL, ByVal 0&, udtST) End If ' Modified to allow for different screen resolutions ' and printer output. Needed to Calculate Font size lngIC = apiCreateIC("DISPLAY", vbNullString, vbNullString, vbNullString) If lngIC <> 0 Then lngYdpi = apiGetDeviceCaps(lngIC, LOGPIXELSY) apiDeleteDC (lngIC) Else lngYdpi = 120 'Default average value End If Call apiSendMessage(hWndDTP, MCM_GETMINREQRECT, ByVal 0&, udtRECT) With udtRECT 'Resize for the number of month to show 'I still don't known why but if I don't add that 0.1 'it will not show the correct number of month's .Right = .Right * (m_MonthColumns + 0.1) .Bottom = .Bottom * m_MonthRows Call apiSetWindowPos(hWndDTP, 0&, 0&, 0&, .Right, .Bottom, 0&) End With 'Get the Windows style so we can calculate a good RECT :-) lngPrevStyle = apiGetWindowLong(Me.hWnd, GWL_STYLE) lngRet = apiAdjustWindowRect(udtRECT, lngPrevStyle, False) ' I've placed the CommandButton at the Bottom of the Control ' so we have to add its Height to our Y size var. With udtRECT Call apiSetWindowPos(Me.hWnd, 0&, 0&, 0&, .Right, _ .Bottom + Abs(.Top) + (cmdOK.Height / (TWIPSPERINCH / lngYdpi)), 0&) 'We have to add 1 pixels( 12 TWIPS) otherwise Access refuses to set the new height. Me.Section(acDetail).Height = (.Bottom * (TWIPSPERINCH / lngYdpi)) + Me.cmdOK.Height + 12 Me.cmdOK.Top = .Bottom * (TWIPSPERINCH / lngYdpi) Me.cmdOK.Width = .Right * (TWIPSPERINCH / lngYdpi) End With 'Align the COmmandButton to the Far left. Me.cmdOK.Left = 0 End Sub http://www.mvps.org/access/forms/frm0052.htm ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 14:53:53 |
|
||
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
надо подключить ActiveX mscomct2.ocx DateTimePicker называется Microsoft Date and Time picker control 6.0 (SP4) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 17:21:37 |
|
||
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
посмотри здесь /topic/59742&hl=datepikerv3 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 17:59:08 |
|
||
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
посмотри здесь /topic/59742&hl=datepikerv3 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 18:00:29 |
|
||
|
Контрол с календариком
|
|||
|---|---|---|---|
|
#18+
Всплывающие календари: для Web страниц http://kozin1.narod.ru/newsite/index.html?webinterface.htm для Access 2000-> http://kozin1.narod.ru/newsite/index.html?datepicker.htm ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.06.2004, 18:00:35 |
|
||
|
|

start [/forum/topic.php?fid=45&msg=32564223&tid=1673776]: |
0ms |
get settings: |
7ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
201ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
60ms |
get tp. blocked users: |
1ms |
| others: | 236ms |
| total: | 536ms |

| 0 / 0 |
