Click to See Complete Forum and Search --> : Controls
ChrisO
May 3rd, 1999, 07:08 AM
I'm using a dialog based MFC app to create a simple calculator app.
How do I display the input from the user and the results of the calculation on the screen.
I've tried using an edit control but this isnt correct as I dont want the user to edit the results I just want to display it.
Also what function do I use to display
Why not use an edit control in read-only mode? Use the control properties in the dialog editor to set this style. If you want to output alpha-numeric characters to a window, you can use TextOut or DrawText. Don't let the function names confuse you - t
You can also use a static control. If you process the WM_CTLCOLORSTATIC message. it can look just like an edit control but is
uneditable by the user. Display your numbers by using m_static.SetWindowText();
Just another alternative. I like this method because an edit control becomes gray if readonly.
Good luck.
Rail Jon Rogut
May 3rd, 1999, 05:20 PM
I would suggest a CEdit derived class which doesn't allow any input from the user -- that way the user could still copy the contents of the edit control to the clipboard.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/
Saeed R
May 3rd, 1999, 05:21 PM
GetDlgItem(ID_EDIT)->EnableWindow(FALSE);//disable the edit ctrl
GetDlgItem(ID_EDIT)->EnableWindow(TRUE);//Enable the edit ctrl
alternatively use static text contol instead
Gaetan Emond
May 19th, 1999, 01:52 PM
Hi, if you need help, i am doing a stage and my 1st application was the same thing as you are doing. So, just send me an email if you have question, i'll answer them with pleasure.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.