VB 如何将dbgrid打印出来

页面导航:首页 > 软件编程 > vb.net > VB 如何将dbgrid打印出来

VB 如何将dbgrid打印出来

来源: 作者: 时间:2016-02-05 12:32 【

Option ExplicitPrivate Sub Command1_Click()Dim I As Long, J As Long, K As LongDim PrintString As StringFor I = 0 To Data1.Recordset.RecordCount - 1If K = DBGri

 

 

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

 

Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<