【正文】
Lf amp。 \picture\) = 用戶(hù)登錄提示 : amp。 \picture\) = New Bitmap( amp。 39。 amp。 39。 amp。initial catalog=重慶新華電腦學(xué)校圖書(shū)管理系統(tǒng) 。登錄窗體代碼 : Imports Public Class FormDengLu Dim biaozhi As Boolean Private Sub ButtonDengLu_Click(ByVal sender As Object, ByVal e As ) Handles = user id=sa。password=。data source=(local) () Dim sqlm As New SqlCommand Dim sqlds As New DataSet Dim sqldapt As New SqlDataAdapter = select * from userinfo where username=39。 amp。 and password=39。 amp。 = sqlconn = sqlm (sqlds, userinfo) If (userinfo). = 0 Then If (用戶(hù)名或密碼錯(cuò)誤 , 錯(cuò)誤提示 , , ) = Then = = () End If Else biaozhi = True () = End If End Sub Private Sub FormDengLu_FormClosing(ByVal sender As Object, ByVal e As ) Handles If biaozhi = False Then End End If End Sub Private Sub FormDengLu_Shown(ByVal sender As Object, ByVal e As ) Handles () = New Bitmap( amp。 \picture\) = New Bitmap( amp。 vbCrLf amp。 系統(tǒng)默認(rèn)用戶(hù)名 amp。 vbCrLf amp。 \picture\) = New Bitmap( amp。i列下標(biāo)的變化范圍 , j行下標(biāo)的變化范圍 Do While j = 1 PrintLeft = Cellheight = (j).Height For i = 0 To 1 CellWidth = (i).Width ((j).Cells(i).Value, , , PrintLeft, PrintTop) (, PrintLeft, PrintTop, CellWidth, Cellheight) PrintLeft = PrintLeft + (i).Width Next PrintHeight = PrintHeight + (j).Height PrintTop = PrintTop + (j).Height j = j + 1 If PrintHeight = Then Exit Do End If Loop If j = 1 Then = True Else = False j = 0 End If Else 39。 Dim PrintHeight As Integer 39。 Dim CellWidth, Cellheight As Integer 39。 Dim i As Integer 39。i列下標(biāo)的變化范圍 , j行下標(biāo)的變化范圍 Do While j = 1 PrintLeft = Cellheight = (j).Height For i = 0 To 1 CellWidth = (i).Width ((j).Cells(i).Value, , , PrintLeft, PrintTop) (, PrintLeft, PrintTop, CellWidth, Cellheight) PrintLeft = PrintLeft + (i).Width Next PrintHeight = PrintHeight + (j).Height PrintTop = PrintTop + (j).Height j = j + 1 If PrintHeight = Then Exit Do End If Loop If j = 1 Then = True Else = False j = 0 End If End If End Sub Private Sub ButtonQuXiao_Click(ByVal sender As , ByVal e As ) Handles () End Sub End Class 讀者查詢(xún)打印窗體代碼 : Public Class FormDuZheChaXunDaYin Public biaozi As Boolean Private Sub ButtonYeMianSheZhi_Click(ByVal sender As , ByVal e As ) Handles = PrintDocument1 () End Sub Private Sub ButtonYuLan_Click(ByVal sender As , ByVal e As ) Handles = PrintDocument1 () End Sub Private Sub ButtonDaYin_Click(ByVal sender As , ByVal e As ) Handles = PrintDocument1 = True = True = True If = Then () End If End Sub Private Sub ButtonYeMeiJiao_Click(ByVal sender As , ByVal e As ) Handles () End Sub Private Sub ButtonQuXiao_Click(ByVal sender As , ByVal e As ) Handles () End Sub Private Sub PrintDocument1_PrintPage(ByVal sender As , ByVal e As ) Handles Dim w, h, x, y As Integer Dim PrintHeight As Integer Dim PrintLeft, PrintTop As Integer Dim CellWidth, Cellheight As Integer Dim i As Integer Dim k As Integer Static j As Integer If biaozi = True Then If Then w = h = y = h / 2 / 2 x = w / 2 ( * ) / 2 (, , , x, y) End If If Then w = h = y = h / 2 / 2 + x = w / 2 ( * ) / 2 (, , , x, y) End If PrintTop = PrintLeft = For k = 0 To 1 ((k).HeaderText, , , PrintLeft, PrintTop) CellWidth = (k).Width Cellheight = (, PrintLeft, PrintTop, CellWidth, Cellheight) PrintLeft = PrintLeft + (k).Width Next PrintTop = PrintTop + PrintHeight = 39。i列下標(biāo)的變化范圍 , j行下標(biāo)的變化范圍 Do While j = 1 PrintLeft = Cellheight = (j).Height For i = 0 To 1 CellWidth = (i).Width ((j).Cells(i).Value, , , PrintLeft, PrintTop) (, PrintLeft, PrintTop, CellWidth, Cellheight) PrintLeft = PrintLeft + (i).Width Next PrintHeight = PrintHeight + (j).Height PrintTop = PrintTop + (j).Height j = j + 1 If PrintHeight = Then Exit Do