BOOL CCEDIT4Dlg::OnInitDialog()
{
m_edit1.SetWindowText("Hello World!");
SetDlgItemText(IDC_EDIT2,"I like C++!");
}
void CCEDIT4Dlg::OnBlueradio2()
{
bkColour = RGB(0,0,255);
txtColour = RGB(0,0,0);
m_edit1.SetFocus();
}
void CCEDIT4Dlg::OnGreenradio3()
{
bkColour = RGB(0,255,0);
txtColour = RGB(128,128,128);
m_edit1.SetFocus();
}
void CCEDIT4Dlg::OnYellowradio4()
{
bkColour = RGB(255,255,0);
txtColour = RGB(128,0,128);
m_edit1.SetFocus();
}
void CCEDIT4Dlg::OnRedradio1()
{
// TODO: Add your control notification handler code here
bkColour = RGB(255,0,0);
txtColour = RGB(255,255,255);
m_edit1.SetFocus();
//GetDlgItem(IDC_EDIT2) ->SetFocus();
}
HBRUSH CCEDIT4Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if (nCtlColor == CTLCOLOR_EDIT)
{
//pDC -> SetTextColor(Colour);
pDC -> SetBkColor(bkColour);
pDC -> SetTextColor(txtColour);
}
// TODO: Return a different brush if the default is not desired
return hbr;
}