Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text color control in dialog initiated by a button
#1
In the dialog that follows button-3 starts a long calculation procedure, simulated in the example by a wait statement for 5s. Before that, a static message is displayed and also the color of the font of another static control has to be changed. Nevertheless, the later occurs only when the 5s holding period is finished. I welcome any advice or guidance to overcome this peculiar behavior. Many thanks in advance.

Function Dialog32_Buttons_Control
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 195 108 "Dialog"
;3 Button 0x54032000 0x0 19 18 48 14 "Button-3"
;4 Button 0x54032000 0x0 83 18 48 14 "Button-4"
;5 Static 0x54000000 0x0 59 57 48 12 "Text"
;6 Static 0x54000000 0x0 20 2 48 12 "Busy"
;1 Button 0x54030001 0x4 77 90 48 14 "OK"
;2 Button 0x54030000 0x4 135 90 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,DT_SetTextColor(hDlg 0xFF0000 "6")    

,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,EnableWindow(id(4, hDlg) 0)

,DT_SetTextColor(hDlg 170 "6")    
,_s="Started"
,_s.setwintext(id(5 hDlg))
,5
,_s="Ended"
,_s.setwintext(id(5 hDlg))
;,DT_SetTextColor(hDlg 0xFF0000 "6")    
,EnableWindow(id(4, hDlg) 1)
,
,case 4
,_s="Continue"
,_s.setwintext(id(5 hDlg))
,
,
,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)