Click here to Skip to main content
16,016,489 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Changing default colour for edit ctrl Pin
Ravi Bhavnani23-May-02 4:40
professionalRavi Bhavnani23-May-02 4:40 
GeneralRe: Changing default colour for edit ctrl Pin
Nnamdi Onyeyiri23-May-02 4:43
Nnamdi Onyeyiri23-May-02 4:43 
GeneralRe: Changing default colour for edit ctrl Pin
Ravi Bhavnani23-May-02 4:47
professionalRavi Bhavnani23-May-02 4:47 
GeneralRe: Changing default colour for edit ctrl Pin
Nnamdi Onyeyiri23-May-02 4:56
Nnamdi Onyeyiri23-May-02 4:56 
GeneralRe: Changing default colour for edit ctrl Pin
Prem Kumar23-May-02 4:41
Prem Kumar23-May-02 4:41 
GeneralRe: Changing default colour for edit ctrl Pin
Nnamdi Onyeyiri23-May-02 4:47
Nnamdi Onyeyiri23-May-02 4:47 
GeneralRe: Changing default colour for edit ctrl Pin
Prem Kumar23-May-02 5:02
Prem Kumar23-May-02 5:02 
GeneralRe: Changing default colour for edit ctrl Pin
Nnamdi Onyeyiri23-May-02 5:22
Nnamdi Onyeyiri23-May-02 5:22 
I have tried what you suggested but it will not work, i even created a fresh class derived from CEdit, where the only thing I did was insert this code:

HBRUSH EditBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CEdit::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	pDC->SetBkColor(RGB(0, 0, 255));

	// TODO: Return a different brush if the default is not desired
	return hbr;
}


and when i dynamically assigned an instance of the class to an edit box with this code:

// this code is in the Dialog .cpp file
EditBox EB;
EB.SubclassDlgItem(IDC_EDIT2, this);


the edit box did not appear, it had not been drawn.Confused | :confused:

Sorrt to be a bother but I am a newbieBlush | :O

==================================================
When Your Mind Wonders...Where Does It Go???
QuestionHow to interact within 2 Dialogs? Pin
23-May-02 4:13
suss23-May-02 4:13 
AnswerRe: How to interact within 2 Dialogs? Pin
Ravi Bhavnani23-May-02 4:27
professionalRavi Bhavnani23-May-02 4:27 
GeneralRe: How to interact within 2 Dialogs? Pin
23-May-02 4:35
suss23-May-02 4:35 
GeneralRe: How to interact within 2 Dialogs? Pin
Ravi Bhavnani23-May-02 4:38
professionalRavi Bhavnani23-May-02 4:38 
GeneralUsing ToolTips with CBitmap objects Pin
23-May-02 3:56
suss23-May-02 3:56 
GeneralRe: Using ToolTips with CBitmap objects Pin
Ravi Bhavnani23-May-02 4:07
professionalRavi Bhavnani23-May-02 4:07 
GeneralRe: Using ToolTips with CBitmap objects Pin
Luis E. Cuadrado24-May-02 4:56
Luis E. Cuadrado24-May-02 4:56 
GeneralRe: Using ToolTips with CBitmap objects Pin
Ravi Bhavnani24-May-02 5:07
professionalRavi Bhavnani24-May-02 5:07 
GeneralThe 'this' operator Pin
afronaut23-May-02 3:49
afronaut23-May-02 3:49 
GeneralRe: The 'this' operator Pin
Tim Smith23-May-02 3:53
Tim Smith23-May-02 3:53 
GeneralRe: The 'this' operator Pin
Le centriste23-May-02 8:52
Le centriste23-May-02 8:52 
GeneralFacing problem while making one button as Default on PropertySheet Pin
Ravi Jadhav23-May-02 3:47
Ravi Jadhav23-May-02 3:47 
GeneralRe: Facing problem while making one button as Default on PropertySheet Pin
Bill Wilson23-May-02 6:18
Bill Wilson23-May-02 6:18 
GeneralRe: Facing problem while making one button as Default on PropertySheet Pin
Ravi Jadhav23-May-02 19:09
Ravi Jadhav23-May-02 19:09 
GeneralRe: Facing problem while making one button as Default on PropertySheet Pin
Bill Wilson24-May-02 5:56
Bill Wilson24-May-02 5:56 
GeneralRe: Facing problem while making one button as Default on PropertySheet Pin
Ravi Jadhav24-May-02 20:48
Ravi Jadhav24-May-02 20:48 
GeneralWindows Fonts Problem Pin
23-May-02 3:39
suss23-May-02 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.