|
-
May 21st, 1999, 10:41 AM
#1
how can I update an edit box
I have a dialog box with an edit box. When the user clicks a calculate button, a new dialog box pops-up and the user can input simple data. In the second dialog box's OnOk(), I calculate a value that I want to put into the first dialog's edit box. But I just can't get anything to work. Is there some command called upon returning to the first dialog box?
Any response any one can give me will be greatly appreciated.
-
May 21st, 1999, 11:06 AM
#2
Re: how can I update an edit box
If you have a variable (e.g., m_result) in second dialog and it will store the calculated value, you can retrieve m_result in dialog 1.
For example:
// when user clicks "Calculate" button in Dialog1
void CDialog1::OnCalculateClicked()
{
UpdateData(); // update all variables
Dialog2 dlg(this);
if(dlg.DoModal()==IDCANCEL) return;
// m_myedit is a numeric variable for editbox
m_myedit = dlg.m_result;
// update dialog
UpdateData(FALSE);
}
Hope this will help. Good luck.
Allen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|