简体   繁体   中英

help with the edit box/Input Box

I created a simple dialog with a label and edit box, then created a class, CInputDlg, added member variables for the label and edit box, and called it

CInputDlg dialog
dialog.m_label = TEXT("Enter a number:");
if (dialog.DoModal() == IDOK) {
  // Do something
}

Now how do I display the text which is entered into the edit box?

In the Handler for the OK button on the Dialog, you should get the TextBox.GetText(), and put it back into a public CString member m_InputString. Then, from the calling function, you can read dialog.m_InputString.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM