Click to See Complete Forum and Search --> : Need help with Edit Box


Markusl
April 29th, 1999, 01:58 PM
I have a dialog with an Edit box. Now I would like to save what ever I type in the box into a string variable´when I either push a button next to the edit box or when I simple hit enter.

Can anyone tell me how this is done?
I'm pretty new to mfc so please try to explain it in detail. Thanks

LJP
April 29th, 1999, 03:05 PM
It is simple. I always use UpdateData(TRUE) and then whatever member variable you have set up for the edit box (using Class Wizard) now contains whatever is in the edit box. To use it with a button, all you need to use in the function is that line. Such as this-

void CDialogDlg::OnButton3()
{
UpdateData(TRUE);
CString Password = m_Edit;
//m_Edit being the member variable for the
// edit box
SavePasswordToRegistry(Password);
}