Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SetDialogFont (background)
#1
Hello there,

I'm using this function SetDialogFont but I'm having trouble putting a background color.
I have this dialog with a background color and for the text I used a different format with a diferent font, size and color but the problem is that on those fields that I changed the font, the background is not formated to the color I chose. This is what I got:

Function resumo_remote
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages





if(!ShowDialog("resumo_remote" &resumo_remote)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 1280 650 "RESUMO DA REDE"
;3 Static 0x54000000 0x0 50 20 280 70 "CS'S"
;4 Static 0x54000000 0x0 50 120 340 70 "ASSIGNED"
;5 Static 0x54000000 0x0 50 220 520 70 "ĂšLTIMO AUDIT"
;6 Static 0x54807000 0x0 800 20 400 70 "3213231"
;7 Static 0x54800000 0x0 800 120 400 70 "5498561"
;8 Static 0x54800000 0x0 800 220 400 70 "ACEITE !"
;10 Static 0x54000000 0x0 160 400 300 200 " ";Verde
;11 Static 0x54000000 0x0 506 400 300 200 " ";Amarelo
;12 Static 0x54000000 0x0 850 400 300 200 " ";Vermelho
;13 Static 0x54000000 0x0 0 0 1282 650 "  "
;1 Button 0x54030001 0x4 702 102 0 0 "OK"
;2 Button 0x54030000 0x4 712 134 0 0 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030408 "" "" "" ""

ret
;messages
__GdiHandle- t_brush
__GdiHandle- t_brush2
__GdiHandle- t_brush3
__GdiHandle- t_brush4
__GdiHandle- t_brush5

sel message
,case WM_INITDIALOG
/-----Fonte e tamanho----
,__Font-- f
,__Font-- f2
,f.Create("Comic sans ms" 70 1)
,f.SetDialogFont(hDlg "3 4 5 6 7 9")
,f.SetDialogFontColor(hDlg 0x000000 "3 4 5 6 7 9")
,f2.Create("Comic sans ms" 70 1)
,f2.SetDialogFont(hDlg "8")
,f2.SetDialogFontColor(hDlg 0x009900 "8")

/---Sys da pintura de background---
,t_brush=CreateSolidBrush(0x00CCFF) ;;create brush of random color
,InvalidateRect id(13 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC
,t_brush2=CreateSolidBrush(0x009900) ;;create brush of random color
,InvalidateRect id(10 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC
,t_brush3=CreateSolidBrush(0x00FFFF) ;;create brush of random color
,InvalidateRect id(11 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC
,t_brush4=CreateSolidBrush(0x000099) ;;create brush of random color
,InvalidateRect id(12 hDlg) 0 1 ;;redraw; then it sends WM_CTLCOLORSTATIC

,case WM_DESTROY
,case WM_COMMAND goto messages2

/---Pintura dos fields---
,case WM_CTLCOLORSTATIC
,sel GetDlgCtrlID(lParam)
,,case 13
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush
,sel GetDlgCtrlID(lParam)
,,case 10
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush2
,sel GetDlgCtrlID(lParam)
,,case 11
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush3
,sel GetDlgCtrlID(lParam)
,,case 12
,,SetBkMode wParam 1 ;;draw text transparently
,,ret t_brush4

ret

;messages2
sel wParam


,case IDOK
,case IDCANCEL
ret 1

How can I edit the text field background?

Thank you very much!


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)