<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
關于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), x, 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.Font, Brushes.Black, x, y)
如果要列印邊框:
e.Graphics.DrawRectangle(New Pen(Color.Black), x, y, obj.width, obj.height)
next
__________________________________________________________________________
copy螢幕
貼出再列印
__________________________________________________________________________