[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do i print ?

Posted on 2000-05-10
1
Medium Priority
?
206 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 150 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

829 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