vb基础   vb实例教程   api调用   控件使用   经验技巧   数据库操作   算法及技术   vb源码下载
您的位置:首页 >> vb教程 >> 控件使用

VB如何将dbgrid印出来
出处:网络

Option Explicit

Private Sub Command1_Click()

Dim I As Long, J As Long, K As Long

Dim PrintString As String

For I = 0 To Data1.Recordset.RecordCount - 1

If K = DBGrid1.VisibleRows Then

DBGrid1.Scroll 0, DBGrid1.VisibleRows

K = 0

End If

For J = 0 To DBGrid1.Columns.Count - 1

PrintString = PrintString &

DBGrid1.Columns(J).CellText(DBGrid1.RowBookmark(K)) & "/"

Next

Printer.Print PrintString

PrintString = ""

K = K + 1

DoEvents

Next

End Sub

Private Sub Form_Activate()

Data1.Recordset.MoveLast

Data1.Recordset.MoveFirst

End Sub

[返回]

     

首页 | 设为首页 | 加入收藏 | 关于本站 | 友情链接 | 版权声明

     
 
Copyright© www.bianceng.cn Powered by 编程入门网 All Rights Reserved
吉ICP备06005558号