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 ......
转自:http://www.52arm.com/Article_Show.asp?ArticleID=186
作者:weidian ---本站原创 点击数:4721 发表时间:2008-5-7 编辑:sanzang
Winsock控件建立在TCP、UDP协议的基础上,完成与远程计算机的 ......
这段时间在移植项目的过程中,起初我想判断一个字符串中是否存在某字符(串),直接的使用方法是用instr(start,string1,string2,VB compare),但经过分析在VB中可以只用一下方法来判断!
1.常用的INStr方法
Function InStr([Start], [String1], [String2], [Compare A ......
使用c#语言在.net平台生成的dll是基于MSIL的二进制代码,通常情况下是无法被native的语言和程序调用的(例如vb,vc,delphi)。但是一般来说windows上native的程序都是可以直接使用com对象的。通过.net平台提供的一些工具,可以为其伪造一个com接口并注册到系统中。此时,可以在native的程序里,通过这个伪com接口来实现此. ......
主窗体代码:
'打开网页
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'复制文件
Private Declare Fu ......