Displaying text in an Edit Box 
Author Message
 Displaying text in an Edit Box

Hi,

I'm doing a cash register and my display is a very big EDIT BOX  box running
the whole length of the top of the screen. What I am trying to do is on the
first line of the edit box have a subtotal price and underneath it a
couple of lines is have a grand total (tax included) price. Like this:
                                            Your Sub total is: $12.50

                                            Your Grand total is: $14.25

However, no matter what I try, I can't get it. I get the first line only.
I've tried
various ways of placing \n and endl but no luck. I thought maybe I'd have to
use two edit boxes but first I want to see if this is possible.

Thanks for any help

void CCalcDlg::OnTotal()
{
 char buffer[80];

  CString x = "Your subtotal is: ";

  m_editbox = x + "$" + gcvt(totalprice, 10, buffer);

    // +"\n\n"
  //endl;

 //CString y = "Your Grandtotal is: ";

 //m_editbox = y + "$" + gcvt(Grandtotalprice, 10, buffer) ;

 UpdateData(false);

Quote:
}



Tue, 15 Apr 2003 22:37:09 GMT  
 Displaying text in an Edit Box
To force new line in an edit box, use "\r\n" sequence.
--
With best wishes,
    Igor Tandetnik


Quote:
> Hi,

> I'm doing a cash register and my display is a very big EDIT BOX  box
running
> the whole length of the top of the screen. What I am trying to do is on
the
> first line of the edit box have a subtotal price and underneath it a
> couple of lines is have a grand total (tax included) price. Like this:
>                                             Your Sub total is: $12.50

>                                             Your Grand total is: $14.25

> However, no matter what I try, I can't get it. I get the first line only.
> I've tried
> various ways of placing \n and endl but no luck. I thought maybe I'd have
to
> use two edit boxes but first I want to see if this is possible.

> Thanks for any help

> void CCalcDlg::OnTotal()
> {
>  char buffer[80];

>   CString x = "Your subtotal is: ";

>   m_editbox = x + "$" + gcvt(totalprice, 10, buffer);

>     // +"\n\n"
>   file://endl;

>  file://CString y = "Your Grandtotal is: ";

>  file://m_editbox = y + "$" + gcvt(Grandtotalprice, 10, buffer) ;

>  UpdateData(false);
> }



Tue, 15 Apr 2003 23:08:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. display text in the edit box during the excution of program

2. Displaying text in Edit Box

3. Wrapping text in text box or edit box

4. Display text in edit box at runtime

5. Problems displaying text in edit box

6. Display text in edit boxes

7. Displaying Integers in an Edit Box or List Box

8. list box text to edit box

9. press enter in an edit box and make it happen in an other edit box too

10. Change the background color of a dialog box and change text color of Edit Box, Static Text, Rich Edit

11. *** Edit box *** Edit Box *****

12. **** Edit box *** Edit box ***

 

 
Powered by phpBB® Forum Software