Thread: Printing multi-lines?

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Printing multi-lines?

    I already have the print function. I just want to know how to print multiple lines. It's because right now it prints on one even if the edit box has more than one line of text.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    '\n' doesnt work?
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    \n in windows? haha, ya right!

    ok, first make sure yor button has style ES_MULTILINE and I think ES_WANTRETURN (but you don't really need ES_WANTRETURN) then to add multiple lines of text use \r\n instead of \n.

  4. #4
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Arrow Noooo....not that...

    I mean from and EDIT box. When I type on multiple lines, it puts boxes on the paper where the new line should come in.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  5. #5
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    I think you need to declare a TEXTMETRIC structure and fill it with GetTextMetric(HDC dc, TEXTMETRIC *texm );//<---sample prototype

    Anyway try it and also create two ints to hold the current output location(X,Y). Set Y to = texm.tmHeight + texm.ExternalLeading, then when you are ready to print on a new line, do Y+=Y;

    Of course Y, and X will be arguments passed to TextOut(), anyway hope that helps a little!

    Windows is so confusing! Even Simple things are made difficult!
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 10-07-2008, 06:19 PM
  2. Printing Lines to .txt File
    By Programmer3922 in forum C Programming
    Replies: 2
    Last Post: 08-02-2008, 12:45 PM
  3. Help printing a multi array
    By cjohnman in forum C Programming
    Replies: 4
    Last Post: 05-05-2008, 01:35 PM
  4. Line Counting
    By 00Sven in forum C Programming
    Replies: 26
    Last Post: 04-02-2006, 08:59 PM
  5. Printing 20 lines at a time
    By csmatheng in forum C Programming
    Replies: 5
    Last Post: 04-30-2002, 04:11 PM