如何从SDI应用程序的CFormView打印ListCtrl的数据 [英] How to Print a data of ListCtrl from CFormView of SDI Application
本文介绍了如何从SDI应用程序的CFormView打印ListCtrl的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
谁能让我知道从SDI应用程序的CFormview打印编辑框或listctrl数据的方法吗?
Hello All,
Can anyone let me know a way to print data of edit box or listctrl from CFormview of SDI Application?
推荐答案
您可以从editbox或list控件中读取数据,并且使用GDI函数绘制(可能是TextOut())来打印DC.
You can get read the data from editbox or list control and draw (May be TextOut()) it using GDI functions to printer DC.
在窗口上绘制某些东西时,我们将窗口DC与GDI函数一起使用.同样,要绘制到打印机,我们必须使用打印机DC而不是具有GDI功能的窗口DC.也许您可以看看以下文章以了解详细信息:
http://msdn.microsoft.com/en-us/library/df9f4ta6(VS .80).aspx [ ^ ]
使用MFC轻松打印 [
When we draw something on the window, we use window DC with GDI functions. Similarly to draw to a printer we have to use printer DC instead of window DC with the GDI functions. May be you can take a look at the following articles for details:
http://msdn.microsoft.com/en-us/library/df9f4ta6(VS.80).aspx[^]
Printing with MFC Made Easy[^]
请尝试:):
Please try :) :
{
...
CRect crLocation(0, 0, 1000, 1000);
pDC->Rectangle(crLocation);
crLocation.DeflateRect(20, 20, 20, 20);
CString cszTest(_T("this is a long test line to be printed here and now :)"));
pDC->DrawText(cszTest,
crLocation,
DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK);
...
}
这篇关于如何从SDI应用程序的CFormView打印ListCtrl的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文