标题:问题没解决:打印时强行换页的函数是什么?
只看楼主
lisir888
Rank: 1
等 级:新手上路
帖 子:259
专家分:0
注 册:2006-8-23
 问题点数:0 回复次数:4 
问题没解决:打印时强行换页的函数是什么?
问题没解决:打印时强行换页的函数是什么?哪位知道? 在此谢过了!!急求!!

[此贴子已经被作者于2006-11-2 16:25:23编辑过]


搜索更多相关主题的帖子: 函数 打印 
2006-11-02 16:24
lisir888
Rank: 1
等 级:新手上路
帖 子:259
专家分:0
注 册:2006-8-23
得分:0 
哪位知道啊。帮帮忙行吗?
2006-11-03 11:08
marer
Rank: 2
等 级:新手上路
威 望:3
帖 子:928
专家分:0
注 册:2005-7-18
得分:0 
//PrintDocument对象的打印事件
private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString("成绩单",new Font("宋体",20,FontStyle.Bold),Brushes.Black,350,100);
e.Graphics.DrawLine(Pens.Black,new Point(20,160),new Point(e.PageBounds.Width-20,160));
e.Graphics.DrawString("学号:",new Font("宋体",10,FontStyle.Regular),Brushes.Black,30,190);
e.Graphics.DrawString(frmLogin.uIds,new Font("宋体",10,FontStyle.Regular),Brushes.Black,80,190);
e.Graphics.DrawString("姓名:",new Font("宋体",10,FontStyle.Regular),Brushes.Black,230,190);
e.Graphics.DrawString(frmLogin.uName,new Font("宋体",10,FontStyle.Regular),Brushes.Black,280,190);
e.Graphics.DrawLine(Pens.Black,new Point(20,220),new Point(e.PageBounds.Width-20,220));
e.Graphics.DrawString("课程编号",new Font("宋体",10,FontStyle.Regular),Brushes.Black,30,250);
e.Graphics.DrawString("课程名称",new Font("宋体",10,FontStyle.Regular),Brushes.Black,180,250);
e.Graphics.DrawString("分数",new Font("宋体",10,FontStyle.Regular),Brushes.Black,400,250);
e.Graphics.DrawString("考试次数",new Font("宋体",10,FontStyle.Regular),Brushes.Black,480,250);
e.Graphics.DrawString("是否补考",new Font("宋体",10,FontStyle.Regular),Brushes.Black,560,250);
float height=280; //纵坐标
int aa=0; //记录每一页的显示数量
while(pagecount<count)
{
DataRow r=this.fraction.tbl.Rows[pagecount];
e.Graphics.DrawString(r[0].ToString(),new Font("宋体",10,FontStyle.Regular),Brushes.Black,30,height);
e.Graphics.DrawString(r[1].ToString(),new Font("宋体",10,FontStyle.Regular),Brushes.Black,180,height);
e.Graphics.DrawString(r[2].ToString(),new Font("宋体",10,FontStyle.Regular),Brushes.Black,400,height);
e.Graphics.DrawString(r[3].ToString(),new Font("宋体",10,FontStyle.Regular),Brushes.Black,480,height);
e.Graphics.DrawString(r[4].ToString(),new Font("宋体",10,FontStyle.Regular),Brushes.Black,560,height);
height+=30;
pagecount++;
aa++;
//大于25行后显示新页
if(aa>25)
{
e.HasMorePages=true;
break;
}
}
}

public class 人生历程 extends Thread{public void run(){while(true){努力,努力,再努力!!;Thread.sleep(0);}}}
2006-11-03 11:46
skyland84
Rank: 2
等 级:新手上路
威 望:4
帖 子:544
专家分:0
注 册:2006-10-9
得分:0 
代码很简单呢~!
不过怎么链接到打印机?
应该又接口吧?
这个我不太懂

决定人生~
2006-11-03 13:25
lisir888
Rank: 1
等 级:新手上路
帖 子:259
专家分:0
注 册:2006-8-23
得分:0 
二楼的,那样行吗?我怎么试着不行啊。
2006-11-04 00:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-100359-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.201657 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved