The etched horizontal line color is different when I create dynamically and then from resource. What for?

When I use the RC file with specified in DIALOGEX

// In .RC file
CONTROL         "",IDC_SEPARATOR_0,"Static",SS_ETCHEDHORZ,7,7,139,1

      

It turns out gray. But when I do it dynamically:

CStatic separator; // in MFC dialogue class

// in OnInitDialog()
separator.Create(nullptr, WS_CHILD | SS_ETCHEDHORZ | WS_VISIBLE, rect, this, id + 1);

      

It turns out to be dark gray. Example shown here:

enter image description here

You should see two lines on the screen. The upper line is slightly darker than the lower one. Does anyone know why?

+3


source to share





All Articles