WINFORM 中 LISTVIEW 打印问题

chgjz 2014-07-27 09:09:25
我在LISTVIEW 动态添加了 Items 。每个ITEMS 都动态引用了ImageList 的图片。整个LISTVIEW出来的效果如图

我现在苦于怎么把它打印出来。高人指点
...全文
132 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
我不懂电脑 2014-07-27
  • 打赏
  • 举报
回复
http://bbs.csdn.net/topics/390844425
threenewbee 2014-07-27
  • 打赏
  • 举报
回复
http://blog.csdn.net/hemingwang0902/article/details/1615602
wangnaisheng 2014-07-27
  • 打赏
  • 举报
回复
chgjz 2014-07-27
  • 打赏
  • 举报
回复
搞定了,还是要通过绘画的方式。 Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage e.Graphics.DrawString("减价通知", New Font(Font.FontFamily, 20, FontStyle.Bold), Brushes.Black, 300, 50) e.Graphics.DrawString(Date.Now, New Font(Font.FontFamily, 13, FontStyle.Bold), Brushes.Black, 450, 80) 'e.Graphics.DrawImage(_NewBitmap, 100, 100, _NewBitmap.Width, _NewBitmap.Height) '宽: 700 间隔 :40 起始:10 Dim iRowHeight As Integer = 140 Dim ipageWidth As Integer = ListView1.Width Dim DWidth As Integer = 10 Dim DHeight As Integer = 100 Dim iTage As Integer = 0 For Each odr As DataRow In oGoodDS.Tables(0).Rows If iTage = 4 Then iTage = 0 DWidth = 10 DHeight = DHeight + iRowHeight + 20 End If e.Graphics.DrawImage(ImageList1.Images.Item(odr("JID").ToString), DWidth, DHeight, 120, 120) e.Graphics.DrawString(ListView1.Items(odr("JID").ToString).Text, Font, Brushes.Black, DWidth, DHeight + 125) iTage = iTage + 1 DWidth = DWidth + 160 Next End Sub

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧