Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Edit Box content when Button is clicked in mfc

Tags:

visual-c++

mfc

I have an Edit Box and a Button on a dialog. How can I change the content in the edit box runtime as the button is clicked? I have to read a new record from a file and post it in the Edit Box as the Button is clicked and I am using mfc.

like image 882
digvijay Avatar asked Jan 31 '12 06:01

digvijay


1 Answers

Once you have trapped the button press, in most cases the easiest way to change text in an Edit Control is:

SetDlgItemText(IDC_EDIT_ID, "Desired Text String")

Where IDC_EDIT_ID is the ID of the Edit Control (set in the properties window)

like image 74
SuwaneeCreek Avatar answered Jan 04 '23 01:01

SuwaneeCreek