Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change background color of editfield on button click
#1
Is it possible to change the background color of an editfield when a button is clicked?
I can make it work on dialog init, but not on button click:


Function Example___on_button_click_change_background_color
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 222 128 "Dialog"
;3 Button 0x54032000 0x0 51 21 122 29 "Make editfield-backrgournd yellow"
;4 Edit 0x54231044 0x200 12 54 199 52 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""

str controls = "4"
str e4
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,,int backcolor=0x00ffff
,,int hbrush=CreateSolidBrush(backcolor)
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3
,;; make background of editfield, yellow
ret 1


Messages In This Thread
Change background color of editfield on button click - by r0n - 03-29-2018, 01:19 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)