When I try to use the Control Send to highlight text, nothing happens. But when I use Control Post, the highlighting works fine.
Why would that be? Here's the test code I tried.
If anything, I expected SEND to work immediately, and POST to possibly have some delay.
I read several posts here which indicated SEND would work but I'm not getting the expected results.
Why would that be? Here's the test code I tried.
Code:
#Compile Exe #Include "win32api.inc" Global hDlg As Dword Function PBMain() As Long Dialog New Pixels, 0, "Highlight",300,300,125,100, _ %WS_SysMenu, 0 To hDlg Control Add TextBox, hDlg, 100,"Edit Me!", 10,10,100,20 Control Add TextBox, hDlg, 200,"Edit Me 2!", 10,40,100,20 Dialog Show Modal hDlg Call DlgProc End Function CallBack Function DlgProc() As Long If Cb.Msg = %WM_Command Then If Cb.Ctl = 100 And Cb.CtlMsg = %EN_SetFocus Then ' Control Send hDlg, 100, %EM_SETSEL, 0, -1 Control Post hDlg, 100, %EM_SETSEL, 0, -1 ElseIf Cb.Ctl = 200 And Cb.CtlMsg = %EN_SetFocus Then ' Control Send hDlg, 200, %EM_SETSEL, 0, -1 Control Post hDlg, 200, %EM_SETSEL, 0, -1 End If End If End Function
I read several posts here which indicated SEND would work but I'm not getting the expected results.
Comment