多谢啦!
试验的过程中遇到一点问题
在form、Picturebox上都可以
用printer对象就不行了
后来还是在microsoft的knowledge base找到了答案
如果装过vs97的sp2或者更高版本
就不能直接用printer.hdc,而是要把printer.hdc保存到一个变量里面
原因如下
Print and not referencing the printer object directly while setting up the font and printing with it. If you use TextOut with "Printer.hDC" instead of a local variable, it will fail. Any reference to a printer object property or method is a use of the printer object and will cause the printer object to reset its font/pen/brush. Therefore, the values of all printer object properties that you need to use with the new font/pen/brush must be saved into variables before using SelectObject, and then only use the variables.