📄 frmstiao.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmstiao
BorderStyle = 3 'Fixed Dialog
Caption = "承兑台帐边距调试"
ClientHeight = 3555
ClientLeft = 45
ClientTop = 330
ClientWidth = 5415
Icon = "frmstiao.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3555
ScaleWidth = 5415
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame3
Height = 502
Left = 240
TabIndex = 16
Top = 2880
Width = 4935
Begin VB.CommandButton Command3
Caption = "确定"
Height = 340
Left = 3950
TabIndex = 21
Top = 120
Width = 975
End
Begin VB.CommandButton Command5
Caption = "取消"
Height = 340
Left = 2965
TabIndex = 20
Top = 120
Width = 975
End
Begin VB.CommandButton Command4
Caption = "应用"
Enabled = 0 'False
Height = 340
Left = 1980
TabIndex = 19
Top = 120
Width = 975
End
Begin VB.CommandButton Command2
Caption = "预览"
Height = 340
Left = 995
TabIndex = 18
Top = 120
Width = 975
End
Begin VB.CommandButton Command1
Caption = "默认设置"
Height = 340
Left = 10
TabIndex = 17
Top = 120
Width = 975
End
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3960
Top = 120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
DialogTitle = "打印机设置"
Orientation = 2
End
Begin VB.Frame Frame2
Caption = "说明"
Height = 2535
Left = 240
TabIndex = 9
Top = 240
Width = 2175
Begin VB.Label Label6
Caption = $"frmstiao.frx":000C
Height = 2055
Left = 240
TabIndex = 10
Top = 360
Width = 1695
End
End
Begin VB.Frame Frame1
Height = 2055
Left = 2640
TabIndex = 0
Top = 720
Width = 2535
Begin VB.VScrollBar VScroll4
Height = 270
Left = 1920
Max = 590
TabIndex = 15
Top = 1560
Width = 255
End
Begin VB.VScrollBar VScroll3
Height = 270
Left = 1920
Max = 590
TabIndex = 14
Top = 1146
Width = 255
End
Begin VB.VScrollBar VScroll2
Height = 270
Left = 1920
Max = 400
TabIndex = 13
Top = 733
Width = 255
End
Begin VB.VScrollBar VScroll1
Height = 270
Left = 1920
Max = 400
TabIndex = 12
Top = 320
Width = 255
End
Begin VB.TextBox Text4
Height = 270
Left = 1080
TabIndex = 8
Top = 1560
Width = 1095
End
Begin VB.TextBox Text3
Height = 270
Left = 1080
TabIndex = 7
Top = 1146
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Left = 1080
TabIndex = 6
Top = 733
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Left = 1080
TabIndex = 2
Top = 320
Width = 1095
End
Begin VB.Label Label4
Caption = "右边距"
Height = 255
Left = 360
TabIndex = 5
Top = 1600
Width = 735
End
Begin VB.Label Label3
Caption = "左边距"
Height = 255
Index = 0
Left = 360
TabIndex = 4
Top = 1186
Width = 615
End
Begin VB.Label Label2
Caption = "下边距"
Height = 255
Left = 360
TabIndex = 3
Top = 773
Width = 615
End
Begin VB.Label Label1
Caption = "上边距"
Height = 255
Left = 360
TabIndex = 1
Top = 360
Width = 615
End
End
Begin VB.Label Label5
Caption = "单位:毫米"
Height = 255
Left = 2640
TabIndex = 11
Top = 360
Width = 975
End
End
Attribute VB_Name = "frmstiao"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Frame4_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Command1_Click()
Text1.Text = 19
Text2.Text = 17
Text3.Text = 31
Text4.Text = 28
End Sub
Private Sub Command2_Click()
Dim hh As Integer
With ycdck.Adodc1
.RecordSource = "select 承兑申请人 from 台帐录入"
.Refresh
If .Recordset.RecordCount = 0 Then
MsgBox "需首先输入数据", vbOKOnly Or vbInformation, "系统信息"
Exit Sub
End If
End With
Screen.MousePointer = 11
On Error GoTo errorhandler '如果设置出现错误则可以手工设置
Set obj = New PrinterControl '设置打印方向为横向
obj.ChngOrientationLandscape
X = SetDefaultPrinterOrientation(OrientLandscape) '设置纸张大小为A4
errorhandler:: Printer.EndDoc
If Printer.Orientation = 1 Or Printer.PaperSize <> 9 Then
MsgBox "需首先对默认打印机进行设置," & Chr$(13) & "请设方向为横向、纸张大小为A4。", vbOKOnly Or vbExclamation, "系统信息"
Screen.MousePointer = 0
GoTo bbb
End If
ccc:
hh = 1
'记录打印行号
With ycdck.Adodc1
.RecordSource = "select * from 台帐录入"
.Refresh
Do
If .Recordset.EOF Then
.Recordset.MovePrevious
.Refresh '此句很重要,否则数据预览不正确
Exit Do
End If
If hh <= 20 Then
.Recordset.Fields(13).Value = hh
ElseIf hh > 20 Then
If hh Mod 20 = 0 Then
.Recordset.Fields(13).Value = 20
Else
.Recordset.Fields(13).Value = hh Mod 20
End If
End If
hh = hh + 1
.Recordset.Update
.Recordset.MoveNext
Loop
End With
Unload datapr
Unload DataEnvironment1
DataEnvironment1.Connection1.Open "data.mdb"
'打开关闭结束
With datapr
.LeftMargin = Val(Text3) * 56.7
.RightMargin = Val(Text4) * 56.7
.TopMargin = Val(Text1.Text) * 56.7
.BottomMargin = Val(Text2.Text) * 56.7
Screen.MousePointer = 0
.Show 1
End With
Exit Sub
bbb:
On Error GoTo Exitsub
CommonDialog1.Flags = cdlPDPrintSetup
CommonDialog1.ShowPrinter
GoTo ccc
Exitsub:
obj.ReSetOrientation '恢复打印机打印方向
End Sub
Private Sub Command3_Click()
Me.Command4_Click
Unload Me
End Sub
Public Sub Command4_Click()
Command4.Enabled = False
With ycdck.Data7.Recordset
.Edit
.Fields(1).Value = Val(Text1.Text)
.Fields(2).Value = Val(Text2.Text)
.Fields(3).Value = Val(Text3.Text)
.Fields(4).Value = Val(Text4.Text)
.Update
End With
With ycdck.Data7.Recordset
For i = 1 To 4
Bj(i) = .Fields(i).Value
Next i
End With
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Screen.MousePointer = 0
End Sub
Private Sub Form_Resize()
With ycdck.Data7.Recordset
Me.Text1.Text = .Fields(1).Value
Me.Text2.Text = .Fields(2).Value
Me.Text3.Text = .Fields(3).Value
Me.Text4.Text = .Fields(4).Value
End With
Command4.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set obj = New PrinterControl
obj.ReSetOrientation '恢复打印机打印方向
End Sub
Private Sub Text1_Change()
If Val(Text1.Text) >= 0 And Val(Text1.Text) <= 36 Then
VScroll1.Value = Val(Text1.Text) * 10
Text2.Text = 36 - Val(Text1.Text)
Else
MsgBox "该值无效!", vbOKOnly Or vbInformation, "系统信息"
Text1 = 19
End If
Command4.Enabled = True
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then '如果按下退格键
Exit Sub
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
Beep
KeyAscii = 0
End If
End Sub
Private Sub Text2_Change()
If Val(Text2.Text) >= 0 And Val(Text2.Text) <= 40 Then
VScroll2.Value = Val(Text2.Text) * 10
Else
MsgBox "该值无效!", vbOKOnly Or vbInformation, "系统信息"
Text2 = 21
End If
Command4.Enabled = True
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then '如果按下退格键
Exit Sub
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
Beep
KeyAscii = 0
End If
End Sub
Private Sub Text3_Change()
If Val(Text3.Text) >= 0 And Val(Text3.Text) <= 59 Then
VScroll3.Value = Val(Text3.Text) * 10
Text4.Text = 59 - Val(Text3.Text)
Else
MsgBox "该值无效!", vbOKOnly Or vbInformation, "系统信息"
Text3 = 31
End If
Command4.Enabled = True
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then '如果按下退格键
Exit Sub
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
Beep
KeyAscii = 0
End If
End Sub
Private Sub Text4_Change()
If Val(Text4.Text) >= 0 And Val(Text4.Text) <= 59 Then
VScroll4.Value = Val(Text4.Text) * 10
Else
MsgBox "该值无效!", vbOKOnly Or vbInformation, "系统信息"
Text4 = 28
End If
Command4.Enabled = True
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then '如果按下退格键
Exit Sub
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
Beep
KeyAscii = 0
End If
End Sub
Private Sub VScroll1_Change()
Text1.Text = VScroll1.Value / 10
End Sub
Private Sub VScroll2_Change()
Text2.Text = VScroll2.Value / 10
End Sub
Private Sub VScroll3_Change()
Text3.Text = VScroll3.Value / 10
End Sub
Private Sub VScroll4_Change()
Text4.Text = VScroll4.Value / 10
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -