I am doing calculator program by using dialog based vc++/MFC application. In a dialog box, I added a edit text control and a push button. So I need to change/append the text of the edit control box in that dialog when I click the button on the dialog. To display the text am using Setsel() and ReplaceSel() methods in ButtonClicked method, but it's not working.
Show the relevant portion of your code and relevent artical.
basu
If all you want to do is display some text in a
CEdit
control then why not use it's SetWindowText function?The following replaces the contents using your SetSel/ReplaceSel method:
...where
m_editControl
is the edit control. If you want to append the text at the end, simply set the selection to the end:I agree with Goz though; some example code frmo you would help us identify what isn't working for you.