I added a extra Dialog (TestDialog
) in a MFC doc/frame project (Single doc, MFC, VC++2010 project) That dialog has a "EDIT Control" (IDC_EDIT1, m_EditBox1 etc
) box. After starting the MFC program from the DOC/frame Menu I selected the testdialog which then popup or start.
But Whenver I start that Testdialog the EDIT Control box appear as empty and I have to type a starting value (say 100) so that I can press a button (inside testdialog) that runs a program which accept 100 as input.
How and where I can add a starting value say 100 to this Edit control so that when testdialog will open the EDIT control box already will have that default vale ( i,e 100).
TestDialog.cpp file shows
CTestDialog::CTestDialog(CWnd* pParent /*=NULL*/)
: CDialogEx(CTestDialog::IDD, pParent)
, testdlg(0)
{
}
You can use OnInitDialog () to set any dialog values before the dialog displays. There are multiple ways to accomplish it. Here are two...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With