vb 打印
Private Sub PrintTxt(txt As String, ConWidth As Long, LeftPosition As Long)
Dim str As String
Dim str1 As String
Dim len1 As Long
str = txt
len1 = ConWidth
Do While Len(str) > 0
str1 = str
Do While len1 > 0 And Printer.TextWidth(str1) - ConWid > len1
str1 = Left(str1, Len(str1) - 1)
Loop
Printer.CurrentX = LeftPosition
Printer.Print str1 '打印
If Len(str1) = 0 Then Exit Do '不匹配
str = Mid(str, Len(str1) + 1) '截断!
Loop
End Sub
Private Sub PrintBC(prectl As Control)
Dim I As Integer
Dim str As String
Dim str1 As String
Dim len1 As Long
len1 = prectl.Width
If prectl.BorderStyle = 0 Then
ConWid = 90
Else
ConWid = -90
End If
Printer.CurrentX = prectl.Left
Printer.CurrentY = prectl.Top
Printer.Font.Name = prectl.Font.Name
Printer.Font.Size = prectl.Font.Size
'Printer.ForeColor = prectl.ForeColor
str = prectl
For I = 1 To Len(str)
If I > Len(str) Then Exit For
If Asc(Mid(str, I, 1)) = 13 Then
 
相关文档:
通过调用CreateDataSetfromXml取得XML数据
Imports System.Xml
Public Const FILE_CONFIG = "MZZ.xml"
Public Const PATH_CONFIG = "\XML\"
Dim dstXML As DataSet
Dim tblXML_DB As DataTable
Dim dtCod As New DataTable
Dim strSQL As String = ""
clsPublic ......
在很多 VB 的资料库书籍中,都会很完整的提到:如何由其他种类的文件中将资料导入资料库,但是却很少有书提到:如何将资料库中的资料,导出到各种不同的文件类型的文件中,连 VB 的 Help 中也是这样!
或许是大家都认为资料库主题的重点是在资料库本身吧!
但是,在实际的资料库程序运用中,却常常需要将资料库导出到各种 ......
在开发中保持良好的编码规范是十分重要的。我所采用的新的VB.net/ASP.NET编码规范,是一种被证明能明显改善代码可读性,并有助于代码管理、分类的编码规范。采用这种编码规范,能避免如匈牙利命名法带来的繁长前缀,便于记忆变量的用途。下面的介绍这种编码规范。
一、类型级单位的命名
1、类
□以Class声明的类,都必须 ......
Private Declare Function InternetSetCookie Lib "wininet.dll" Alias "InternetSetCookieA" (ByVal lpszUrlName As String, ByVal lpszCookieName As String, ByVal lpszCookieData As String) As Boolean
Private Declare Function InternetGetCookie Lib "wininet.dll" Alias "InternetGetCookieA" (ByVal lpszUrlName ......