change color [modified]
-
plz tel me how to change the color of text in a edit control or static control and also tem how to change color of edit control plz tem me some example (code to understabd is easy) plz..................... Please mail me -- modified at 8:34 Friday 16th June, 2006
-
plz tel me how to change the color of text in a edit control or static control and also tem how to change color of edit control plz tem me some example (code to understabd is easy) plz..................... Please mail me -- modified at 8:34 Friday 16th June, 2006
In OnCtlColor function add this block of code : Define in the header file as follows in the public section: COLORREF m_color; HBRUSH m_brush;
if (pWnd->GetDlgCtrlID () == IDC_EDIT1) { pDC->SetBkColor(m_color); hbr = m_brush; } if (pWnd->GetDlgCtrlID () == IDC_EDIT2) { pDC->SetBkColor(m_color); hbr = m_brush; }
Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_ -- modified at 8:18 Friday 16th June, 2006
-
plz tel me how to change the color of text in a edit control or static control and also tem how to change color of edit control plz tem me some example (code to understabd is easy) plz..................... Please mail me -- modified at 8:34 Friday 16th June, 2006
HBRUSH CAnswerDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); pDC->SetTextColor(RGB(54,97,200));//text //pDC->SetBkColor(RGB(0,0,0));//background return hbr; }
_**
**_
whitesky
-
plz tel me how to change the color of text in a edit control or static control and also tem how to change color of edit control plz tem me some example (code to understabd is easy) plz..................... Please mail me -- modified at 8:34 Friday 16th June, 2006
Just respond to the
WM_CTLCOLOREDIT
message.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
-
HBRUSH CAnswerDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); pDC->SetTextColor(RGB(54,97,200));//text //pDC->SetBkColor(RGB(0,0,0));//background return hbr; }
_**
**_
whitesky
THIS WILL WORK BUT HOW I CAN CHANGE THE COLOR OF EDIT CONTROL AS U TEL BKCOLOR IT WILL CHANGE ONLY TEXT BACKGROUND BUT SIDE OF TEXT DOES NOT CHANGE Please mail me
-
THIS WILL WORK BUT HOW I CAN CHANGE THE COLOR OF EDIT CONTROL AS U TEL BKCOLOR IT WILL CHANGE ONLY TEXT BACKGROUND BUT SIDE OF TEXT DOES NOT CHANGE Please mail me
-
plz tel me how to change the color of text in a edit control or static control and also tem how to change color of edit control plz tem me some example (code to understabd is easy) plz..................... Please mail me -- modified at 8:34 Friday 16th June, 2006
yogendra wrote:
plz tel me how to change the color of text in a edit control or static control and also tem how to change color of edit control plz tem me some example (code to understabd is easy) plz.....................
Better way to
Subclass
both the Controls you can do whatever you want and use those classes. Following link directs you for subclassing Extended Edit and Static controls[^] Knock out 't' from can't, You can if you think you can :cool: