The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keeping focus on control
#1
In the example dialog which follows a certain part of the text in control 3 is selected. However,, if you click on button selection is lost. As a matter of fact I use this button in this example to simulate a series of actions in my actual problem.

I wonder whether the selection can be preserved, even after clicking on button.
Many thanks in advance.

Function Dialog43
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;3 RichEdit20A 0x54233044 0x200 7 0 215 71 ""
;4 Button 0x54032000 0x0 9 77 48 14 "Button"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

str controls = "3"
str re3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,_s="abcd efgh ijkl 12345 pqrst"
,_s.setwintext(id(3 hDlg))
,SendMessage(id(3 hDlg) EM_SETSEL 2 11)
,act id(3 hDlg)

,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)