Hello,
I've got a problem with SysDateTimePick32. Everytime the calender is opened, and a selection is picked, the Focus shifts (unwanted) to the first control on the Dialog.
This can be very annoying. I have several of these date entry fields in a form, together with edit and comboboxes, that need to be filled in in sequence. How can you keep focus on the SysDateTimePick32 control?
An example:
I've got a problem with SysDateTimePick32. Everytime the calender is opened, and a selection is picked, the Focus shifts (unwanted) to the first control on the Dialog.
This can be very annoying. I have several of these date entry fields in a form, together with edit and comboboxes, that need to be filled in in sequence. How can you keep focus on the SysDateTimePick32 control?
An example:
Code:
#Compile Exe #Dim All #Include "WIN32API.INC" #Include "COMMCTRL.INC" #Include "PBForms.INC" %IDD_DIALOG1 = 101 %IDC_SYSDATETIMEPICK32_1 = 1001 %IDC_TEXTBOX1 = 1002 %IDC_TEXTBOX2 = 1003 %IDC_TEXTBOX3 = 1004 %IDC_TEXTBOX4 = 1005 Declare CallBack Function ShowDIALOG1Proc() Declare Function ShowDIALOG1(ByVal hParent As Dword) As Long Function PBMain() PBFormsInitComCtls (%ICC_WIN95_CLASSES Or %ICC_DATE_CLASSES Or %ICC_INTERNET_CLASSES) ShowDIALOG1 %HWND_DESKTOP End Function '-------------------------------------------------------------------------------- Function ShowDIALOG1(ByVal hParent As Dword) As Long Local lRslt As Long, hDlg As Dword, X As Long Dialog New hParent, "Dialog1", 69, 80, 195, 102, %WS_SYSMENU To hDlg Control Add TextBox, hDlg, %IDC_TEXTBOX1, "TextBox1", 5, 5, 100, 13 Control Add TextBox, hDlg, %IDC_TEXTBOX2, "TextBox2", 5, 20, 100, 13 Control Add "SysDateTimePick32", hDlg, %IDC_SYSDATETIMEPICK32_1, _ "SysDateTimePick321", 5, 35, 100, 13, %WS_CHILD Or %WS_VISIBLE Or _ %WS_TABSTOP Or %DTS_SHORTDATEFORMAT Control Add TextBox, hDlg, %IDC_TEXTBOX3, "TextBox3", 5, 50, 100, 13 Control Add TextBox, hDlg, %IDC_TEXTBOX4, "TextBox4", 5, 65, 100, 13 Dialog Show Modal hDlg To lRslt Function = lRslt End Function '--------------------------------------------------------------------------------
Comment