Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit Box Font Color

Status
Not open for further replies.

nbgoku

Programmer
May 25, 2004
108
US
1.cpp
Code:
BOOL CDFBPDlg::OnInitDialog()
{
      //...
	CDFBPDlg m_stcSTSign;

	// TODO: Add extra initialization here
	m_stcSTSign.SubclassDlgItem(IDC_EDIT12, this);
	// Set the text color
	// Tooltip's foreground color
	m_stcSTSign.SetTextColor(RGB(0,157,0));
	// Set the background color
	// Tooltip's background color
	m_stcSTSign.SetBkColor(::GetSysColor(COLOR_MENU));

      //...
	UpdateData(0);
	return TRUE;
}

im trying to edit the font color of some text in a edit box (IDC_EDIT12), but the thing is when i compile the program, i get these 2 error msg

error C2039: 'SetBkColor' : is not a member of 'CDFBPDlg'
error C2039: 'SetTextColor' : is not a member of 'CDFBPDlg'


what to do? i have a 1.h file for it, should i do anything in there?
 
What the heck is a CDFBPDlg, and why are you creating another instance of it on the stack in its own OnInitDialog method, and then subclassing a control to it?

Anyway, it looks like it doesn't have methods SetBkColor() or SetTextColor(). Is this CDFBPDlg some code you wrote, or did you get it from somewhere else? Is it designed to behave like an edit box? If it has some drawing code in it, find out where it sets the text color, and change it there or find out what method to call or variable to set to change the color.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top