双击控件,在该事件中,添加如下代码
void CTest6Dlg::OnChangeEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
CString strtemp;
GetDlgItemText(IDC_EDIT1, strtemp);
if(strtemp == "a")
SetDlgItemText(IDC_EDIT2,"change to a");
if(strtemp == "b")
SetDlgItemText(IDC_EDIT2,"change to b");