如何打印滚动表格... [英] how to Print a scrolled form...

查看:272
本文介绍了如何打印滚动表格...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

我如何从表格中获取打印内容...
当然,我的表单是滚动的...
如果不知道,我可以在下面使用此代码,但是在滚动表单时我不知道该怎么做...

我只是制作一个位图图像,然后将其打印出来...
对我来说就足够了...

hi ..

how can I get a print from my form...
off course my form is scrolled ...
if it doesn''t I know I can use this code comes in the following but I don''t know how to do it when my form is scrolled...

I just make a bitmap image and then print that...
It''s sufficient for me ...

{
Bitmap bitmap = new Bitmap(Form1.Width, Form1.Height);
Form1.DrawToBitmap(bitmap,
     new Rectangle(Form1.ClientRectangle.X, this.ClientRectangle.Y,
         Form1.ClientRectangle.Width, Form1.ClientRectangle.Height));
bitmap.Save("d:\\myPrintScreen.bmp");
}







thanks.

推荐答案

我唯一想到的就是创建一个Panel控件并将AutoSize设置为true,将表单的控件复制到,然后打印该面板.
The only thing I can think of is to create a Panel control with AutoSize set to true, copy the form''s controls into it, and then print that panel.


这篇关于如何打印滚动表格...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆