VB中实现“所见即所得”功能
http://www.ccidnet.com/tech/guide/2001/07/31/58_2812.html
http://www.ccidnet.com/tech/guide/2001/07/31/58_2812.html
解决方案 »
- 用火狐怎么打不开vb大版块的页面?
- 如何判读一个数组是否定义?
- VB高手都到哪里去了!!!难道就真的没有人能够解决这个难题?
- 高手来吧....图标问题
- VB还能生存多少年。现在学的话,学什么比较好!
- 数据库连接与释放问题.(vb+dll+asp)
- 如何用ADO对象把ACCESS数据库表中的记录输出到EXCEL表格中,并自动保存在指定的位置!!!
- 请大侠帮忙了,小弟的问题又来了!~~谢谢,谢谢!~~~路过的也进来看看,给点儿意见!
- 查找到多个记录,如何定位到第一个记录上
- 用vb读出dat文件第二列的最小值,这个最小值接下来我会用到。。谢谢
- 求助!一个易懂的技巧问题,新手高手都可以解决。
- 网上的图片,直接自动存到本地硬盘。
在Show窗体前可以 定义窗体的大小
如:
frm.height =8000
frm.width=6000
frm.show
用printform肯定不行。建议你在excel或access中建一表,把窗体中所填值传过去,再调用excel或access中的打印功能属性打印。你所说height属性改回去的情况,可能是你的窗体的BorderStyle设成了2,设成1就可以了。
希望以上的废话能对你有所帮助。
Dim recPos As Integer
Dim pagChg As BooleanPrivate Sub printm_Click()
If Data1.Recordset.RecordCount = 0 Then Exit Sub
If Data1.Recordset.BOF = False Then Data1.Recordset.MoveFirst
Do
Loop Until print_A_page = True
End SubFunction print_A_page() As Boolean
If Data1.Recordset.EOF = True Then Data1.Recordset.MoveFirst
Data1.Recordset.AbsolutePosition = recPos
pagChg = False
Do While Data1.Recordset.EOF = False
If pagChg = False Then
print0
Data1.Recordset.MoveNext
Else
print_A_page = False
Printer.EndDoc
Exit Function
End If
Loop
print_A_page = True
End FunctionSub print0()
Dim tempStr As String
Dim AddStr As String
Dim LineLen As Double
Dim WordLen As Double
Dim i As Integer
Dim want_print As Boolean
If Printer.CurrentY + heightRec > Printer.Height Then
recPos = Data1.Recordset.AbsolutePosition
pagChg = True
Exit Sub
End IfheightRec = Printer.CurrentY
Printer.CurrentX = Printer.Width / 50
Printer.CurrentY = Printer.CurrentY + Printer.Height / 100
Printer.Line (Printer.CurrentX, Printer.CurrentY)-(Printer.Width * 49 / 50, Printer.CurrentY)
Printer.CurrentX = Printer.Width / 50
Printer.CurrentY = Printer.CurrentY + Printer.Height / 100
tempStr = Data1.Recordset.Fields(0).Name & " " & Data1.Recordset.Fields(0)
LineLen = Printer.TextWidth(tempStr)
AddStr = ""
WordLen = 0
For i = 1 To Data1.Recordset.Fields.Count - 1
AddStr = " " & Data1.Recordset.Fields(i).Name & " " & Data1.Recordset.Fields(i)
WordLen = Printer.TextWidth(AddStr)
If LineLen + WordLen < (Printer.Width * 48 / 50) Then
tempStr = tempStr & AddStr
LineLen = LineLen + WordLen
Else
Printer.Print tempStr
Printer.CurrentX = Printer.Width / 50
Printer.CurrentY = Printer.CurrentY + Printer.Height / 100
tempStr = Data1.Recordset.Fields(i).Name & " " & Data1.Recordset.Fields(i)
LineLen = Printer.TextWidth(tempStr)
AddStr = ""
WordLen = 0
End If
If i = Data1.Recordset.Fields.Count - 1 Then Printer.Print tempStr
Next i
heightRec = Printer.CurrentY - heightRec
End Sub
可printer的A4纸张是11704*16832可见!!下半截,超过了form的基本属性了~~~所以不管怎么使都打不出来了
我也没解决这个问题~~~我想可能用纸张缩放大小适应
或不用fromprint,直接用语句打印~
国家认证证书就现在来说就是,上岗证考出了证书,哪里都能去!!!别去考什么微软的认证,垃圾!!!
考国家颁发的认证!
真接在picture2上绘制图像了,
绘制好后用 {Printer.PaintPicture Picture2.Image, 10, 10}语句在打印机
上打印就用的是A4的纸,在vb中想用好的打印,不要怕多的代码,尤其是一些用报表没法子实现的功能.