Solved

How do i print ?

Posted on 2000-05-10
1
199 Views
Last Modified: 2013-11-20
I have  aCFormView with three edit boxes:

IDC_MYEDIT1      with CString m_Myedit1
IDC_MYEDIT2      with CString m_Myedit2
IDC_MYEDIT3      with CString m_Myedit3

these are positioned in various parts of the dialog box.

What I want to do is print what's contained in these boxes to a printer.

I've tried various example's but can't get this to work and was wondering if anyone knew of any code examples ?

Thanks !
0
Comment
Question by:KAbbott
1 Comment
 
LVL 1

Accepted Solution

by:
tvanceplus earned 50 total points
ID: 2797795
This won't have any formatting, but you can customize that to whatever you want. This will print your items on three separate lines at the top left of the page when the user clicks File|Print.


CMyFormView::OnPrint(CDC* pDC,
                 CPrintInfo* pInfo){


int line=pDC->GetTextExtent("||").cy;
int y=0;

pDC->TextOut(0,y,m_myEdit1);
y+=line;
pDC->TextOut(0,y,m_myEdit2);
y+=line;
pDC->TextOut(0,y,m_myEdit3);

}


Good Luck!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question