Hintergrundfarbe von Controls in TabCtrl
-
Wenn ich in meiner TabCtrl die Hintergrundfarbe mit OnCtlColor() ändere, verändert sich auch die Hintergrundfarbe der ComboBox. Mit OnCtlColor habe ich es nicht geschafft die Hintergrundfarbe der ComboBox zu ändern.
/* set color */ HBRUSH CLanguage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { if (pWnd->GetDlgCtrlID() == IDC_LANGUAGE_SELECTION) { /* make the background transparent */ pDC->SetBkMode(TRANSPARENT); /* Set the text color */ pDC->SetTextColor(TEXT_COLOR); /* Background-Color of the Combobox, white */ return hBrush2; } /* Background-Color of the Dialog, grey */ return hBrush1; }
-
Dann haben die beiden wohl die selbe ID!
Warum prüfst Du nicht auch den Wert von nCtlColor?
-
Die selbe ID haben die nicht. Was ist denn nCtlColor?
-
Wenn ich die Liste öffne ist der Hintergrund grau, er sollte weiß sein.
Nur dort wo die Strings stehen ist er weiß.
-
maRKus23 schrieb:
Die selbe ID haben die nicht. Was ist denn nCtlColor?

Die benutzt OnCtlColor doch, oder?
OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
Schon mal was von Doku gehört?
http://msdn2.microsoft.com/en-us/library/0wwk06hc(vs.80).aspx