gfr1
July 18th, 2005, 09:49 AM
The routine below gets the address of the Edit box that currently has focus and passes that information to a function that checks to see if the text in the control is in the correct format i.e. time(##:##:##.###) This works in MFC how can I do the same thing in a .NET Forms app.
void CConvertDlg::CheckFormat(CString &buff, const int &type)
{
// This functions gets get the address of the current edit box and
// passes that information on to timeformat a libaray routinewhich checks for
// correct format
CWnd *pWnd;
CEdit *Edit;
int id;
pWnd = GetFocus();
id = pWnd->GetDlgCtrlID();
Edit = (CEdit*)GetDlgItem(id);
TimeFormat(Edit,buff,type);
UpdateData(FALSE);
}
void CConvertDlg::CheckFormat(CString &buff, const int &type)
{
// This functions gets get the address of the current edit box and
// passes that information on to timeformat a libaray routinewhich checks for
// correct format
CWnd *pWnd;
CEdit *Edit;
int id;
pWnd = GetFocus();
id = pWnd->GetDlgCtrlID();
Edit = (CEdit*)GetDlgItem(id);
TimeFormat(Edit,buff,type);
UpdateData(FALSE);
}