关于VB.NET的打印
功能 高手都跑那里去了????? 我做了几个窗体,里面有文本框,
标签框,还有datagrid,请问我怎样把这个窗体给打印出来呢? 照着这个窗体的格式打印,请问怎么做啊???? 向高手跪求!! 请说详细些,谢谢!! __________________________________________________________________________ windows.print(),试试 __________________________________________________________________________ 遍历控件,根据位置打印text。 ex: dim obj as Object for each obj in form1.controls x = obj.location.x y = obj.location.y e.Graphics.DrawString(obj.Text,obj.Font,Brushes.Black,x,y) 如果要打印边框: e.Graphics.DrawRectangle(New Pen(Color.Black),y,obj.width,obj.height) next 需要注意的是,如果有container的话,要遍历container内的控件(或者直接用递归。) __________________________________________________________________________ 遍历控件,根据位置打印 ex: dim obj as Object for each obj in form1.controls x = obj.location.x y = obj.location.y e.Graphics.DrawString(obj.Text,obj.height) next __________________________________________________________________________ copy屏幕 貼出再打印 __________________________________________________________________________
原文链接:https://www.f2er.com/vb/263640.html