Announcement

Collapse
No announcement yet.

How to colorize the label

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to colorize the label

    Hi All

    I got this program below, which I was able to color its dialog background Azure but when I add a label to it
    the label's background color is reverted back to gray (which looks awful)

    How to change the color of its label to Dark red and its background color to Azure ?
    Thanks for all help.


    Code:
       #COMPILE EXE
      #RESOURCE MANIFEST, 1, "xpTheme.xml"
    
       GLOBAL hDlg AS DWORD
       %Idc_Cmb = 100
       %Idc_Lab = 108
    
    
    '=================================
       FUNCTION PBMAIN() AS LONG
    
          DIALOG NEW PIXELS, 0, "Countries", 300, 300, 500, 300, %WS_SYSMENU, 0 TO hDlg
          DIALOG SET COLOR  hDlg, %RGB_MEDIUMBLUE , %RGB_AZURE
    
          CONTROL ADD COMBOBOX, hDlg, %Idc_Cmb, , 120, 50, 175, 225, %CBS_DROPDOWN OR %WS_VSCROLL
          CONTROL ADD LABEL , hDlg, %Idc_Lab,"Country : ", 30,50, 60, 20 ,  %SS_CENTER
    
    
          COMBOBOX ADD hDlg, %Idc_Cmb, "Cabo Verde"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Cambodia"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Cameroon"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Canada"
          COMBOBOX ADD hDlg, %Idc_Cmb, "CAR"
    
          COMBOBOX ADD hDlg, %Idc_Cmb, "Cayman Islands"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Chad"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Chile"
    
          COMBOBOX ADD hDlg, %Idc_Cmb, "Colombia"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Comoros"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Congo"
          COMBOBOX ADD hDlg, %Idc_Cmb, "Costa Rica"
    
          DIALOG SHOW MODAL hDlg CALL DlgProc
       END FUNCTION
    
    
     '===============================================
       CALLBACK FUNCTION DlgProc() AS LONG
          IF CB.MSG = %WM_COMMAND AND CB.CTL = %Idc_Cmb AND CB.CTLMSG = %LBN_SELCHANGE THEN
             'MSGBOX "Selected!"
          END IF
       END FUNCTION

    Click image for larger version

Name:	label color.PNG
Views:	74
Size:	22.8 KB
ID:	797490

  • #2
    ? Control set color
    Dale

    Comment


    • #3
      Thank you Dale

      Comment

      Working...
      X