⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 print.shtml

📁 mfc资源大全包含MFC编程各个方面的源码
💻 SHTML
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Zafir Anjum">
   <TITLE>CListCtrl - Print the contents of the list control</TITLE>
</HEAD>
<body background="../fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000" bgproperties="fixed">
<table WIDTH="100%">
<tr WIDTH="100%">
<td align=center><!--#exec cgi="/cgi/ads.cgi"--><td>
</tr>
</table>


<CENTER>
<H3>
<FONT COLOR="#AOAO99">Print the contents of the list control</FONT></H3></CENTER>

<HR WIDTH="100%">
This code was contributed by <A HREF="mailto:rreddy@braintech.com">Ravi Reddy</A>.

<P>I tried to use the Print code
available in your site for List View Control. That was not good enough. The
sample sends WM_PAINT message to itself after adjusting printer DC. The
problem with this is this will only print currently visible items only and
will not take care of Margins etc. It does not take care of number of pages
etc also.

<P>I wrote a slightly enhanced printing functionality here. This priting is
divided into two main functions on the MFC line. OnBeginPrint and OnPrint
as shiown in the following code. These will ideally be called form view
OnFileBeginPrint and OnFilePrint functions.

<P>I have a string list to take the header content. Each string in a string
list will be painted in a separate row.

<P>It has a DrawRow functions which will paint the row on screen (in case of
Owner draw control fron OnDrawItem code) or on printer.
As a matter of fact my CSapListControl has a lot of functionality like,
full row selection, alternate color bands, TreeLike List controlwith expand
and collpase features, virtaul function for Sorting, OnGetDispInfo etc. All
these functions will be called depending on the flags set. For exaple it
has OnDrawItem function, it will

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -