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.
Printable View
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.
'\n' doesnt work?
\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.
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.
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!