This what I am trying to do in an Edit Box: Enter the numbers for a date in an edit box and as I am entering the numbers a forward slash appears at predetermined locations. I type MM and a forward slash appears. Type DD and another slash appears. The end result is mm/dd/yy. I recently used an online application that had such a feature.
I tried using the OnChar() for WM_CHAR but this only deals with the character entered.
I tried using OnChangeEdit for EN_CHANGE but did not get anywhere. What I have below will put a new string in the edit box but the program will lock. Doe anyone have any additional suggestions on how to figure this out.
// 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
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT_NAME);
int nLength = strText.GetLength();
strResult.Format("The lenth is %d ", nLength);