dmcdowell
May 12th, 1999, 01:34 PM
How do I change the text color on my document. Below is my code for getting my selected color from the CColorDialog box which I have implemented in my application. I just don't know what to do with the data I have received.
Any and all comments welcome!!!
void CPropPage1::OnFont()
{
// get value from the register
int SelectedColor = AfxGetApp()->GetProfileInt("Page1", "Color", 0);
// create a dialog color box
CColorDialog *pColor;
// set the default color to the value retrieved from the registry
pColor = new CColorDialog(SelectedColor);
if (pColor->DoModal() == IDOK)
{
// save the color selected
SelectedColor = pColor->GetColor();
}
// save this value to the registry for later use
AfxGetApp()->WriteProfileInt("Page1", "Color", SelectedColor);
}
Any and all comments welcome!!!
void CPropPage1::OnFont()
{
// get value from the register
int SelectedColor = AfxGetApp()->GetProfileInt("Page1", "Color", 0);
// create a dialog color box
CColorDialog *pColor;
// set the default color to the value retrieved from the registry
pColor = new CColorDialog(SelectedColor);
if (pColor->DoModal() == IDOK)
{
// save the color selected
SelectedColor = pColor->GetColor();
}
// save this value to the registry for later use
AfxGetApp()->WriteProfileInt("Page1", "Color", SelectedColor);
}