Thread: background of dialogbox transparent.. why?

  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    5

    background of dialogbox transparent.. why?

    Hi, im having a problem with the background of a dialogbox from a resource script.

    Those Control windows appear on the screen as they should, but the background window don't. Why is this happening?



    Code:
    IDD_ADDCLIENTFORM DIALOG 0, 0, 250, 244
    STYLE DS_SYSMODAL | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | //DS_CENTER | 
          WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_POPUP | WS_SYSMENU
    CAPTION "Adicionar Cliente"
    FONT 8, "Ms Shell Dlg"
    {
        DEFPUSHBUTTON   "Add", IDOK, 131, 213, 45, 19
        PUSHBUTTON      "Cancel", IDCANCEL, 188, 212, 45, 19
        GROUPBOX        "Info", IDC_STATIC, 13, 33, 222, 97, 0, WS_EX_TRANSPARENT
        LTEXT           "no", IDC_STATIC, 25, 50, 23, 8, SS_LEFT
        EDITTEXT        IDC_EDIT1, 51, 49, 94, 12, ES_AUTOHSCROLL
        LTEXT           "Ape", IDC_STATIC, 25, 69, 24, 8, SS_LEFT
        EDITTEXT        IDC_EDIT2, 51, 68, 94, 12, ES_AUTOHSCROLL
        LTEXT           "Se", IDC_STATIC, 157, 50, 17, 8, SS_LEFT
        AUTORADIOBUTTON "M", IDC_RADIO1, 179, 51, 22, 8
        AUTORADIOBUTTON "F", IDC_RADIO2, 201, 51, 21, 8
        EDITTEXT        IDC_EDIT3, 62, 154, 81, 12, ES_AUTOHSCROLL | ES_NUMBER
        LTEXT           "Tel", IDC_STATIC, 24, 156, 34, 8, SS_LEFT
        COMBOBOX        IDC_COMBO1, 25, 106, 120, 15, CBS_DROPDOWN | CBS_HASSTRINGS
        CONTROL         "", IDC_DATETIMEPICKER1, DATETIMEPICK_CLASS, WS_TABSTOP | DTS_RIGHTALIGN, 67, 88, 78, 11
        LTEXT           "Nas", IDC_STATIC, 26, 88, 38, 8, SS_LEFT
        CONTROL         "", IDC_STATIC, WC_STATIC, SS_ETCHEDFRAME | SS_CENTERIMAGE, 156, 67, 62, 49, WS_EX_DLGMODALFRAME | WS_EX_TRANSPARENT
        LTEXT           "Sem", IDC_STATIC, 171, 84, 29, 8, SS_LEFT
        EDITTEXT        IDC_EDIT4, 111, 11, 30, 12, ES_AUTOHSCROLL
        LTEXT           "Client", IDC_STATIC, 75, 13, 32, 8, SS_LEFT
        GROUPBOX        "Cont", IDC_STATIC, 14, 141, 222, 55, 0, WS_EX_TRANSPARENT
        LTEXT           "Em", IDC_STATIC, 26, 176, 18, 8, SS_LEFT
        EDITTEXT        IDC_EDIT5, 62, 174, 82, 12, ES_AUTOHSCROLL | ES_LOWERCASE
        AUTOCHECKBOX    "Pro?", IDC_CHECKBOX1, 160, 156, 55, 8
        AUTOCHECKBOX    "Pro?", IDC_CHECKBOX2, 160, 177, 55, 8
        LTEXT           "??", IDC_STATIC, 181, 13, 42, 8, SS_LEFT
    }
    Last edited by Telmo Vaz; 06-09-2013 at 05:11 PM.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Try removing the WS_EX_TRANSPARENT style from your controls.

    If you need a control to be 'transparent' then adjust the z-order so the higher 'level' controls are drawn on top (or give these controls the TOPMOST style) or use ShowWindow() to hide it.

    Other than that post the callback as this can be a paint / erase background issue.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Setting focus on DialogBox in DialogBox while both creating
    By vantooh in forum Windows Programming
    Replies: 3
    Last Post: 01-24-2013, 09:34 PM
  2. Replies: 0
    Last Post: 01-23-2013, 11:58 AM
  3. Transparent Background
    By C_ntua in forum C# Programming
    Replies: 4
    Last Post: 01-17-2010, 05:45 PM
  4. How to make a "transparent" User Control Background.
    By indigo0086 in forum C# Programming
    Replies: 2
    Last Post: 01-01-2008, 11:50 AM
  5. Transparent background
    By maxorator in forum Windows Programming
    Replies: 4
    Last Post: 11-02-2005, 08:02 PM

Tags for this Thread