CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Controls

  1. #1
    Join Date
    May 1999
    Location
    Canada
    Posts
    7

    Controls

    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

  2. #2
    Guest

    Re: Controls

    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

  3. #3
    Guest

    Re: Controls

    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.


  4. #4
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: Controls

    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
    [email protected]
    http://home.earthlink.net/~railro/

  5. #5
    Join Date
    May 1999
    Posts
    78

    Re: Controls

    GetDlgItem(ID_EDIT)->EnableWindow(FALSE);//disable the edit ctrl
    GetDlgItem(ID_EDIT)->EnableWindow(TRUE);//Enable the edit ctrl
    alternatively use static text contol instead



  6. #6
    Join Date
    May 1999
    Posts
    30

    Re: Controls

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured