-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrmPrintSetup.frm
More file actions
279 lines (273 loc) · 8.74 KB
/
frmPrintSetup.frm
File metadata and controls
279 lines (273 loc) · 8.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
VERSION 5.00
Begin VB.Form frmPrintSetup
BorderStyle = 1 'Fixed Single
Caption = "版面设定"
ClientHeight = 4050
ClientLeft = 2850
ClientTop = 2700
ClientWidth = 4950
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4050
ScaleWidth = 4950
Begin VB.Frame Frame2
Caption = "预览条件"
Height = 1332
Left = 336
TabIndex = 16
Top = 1992
Width = 4308
Begin VB.TextBox txtZoom
Alignment = 2 'Center
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3072
TabIndex = 19
Top = 912
Width = 564
End
Begin VB.OptionButton optRePrint
Caption = "不重新绘图,但是重新设定原始图片的比例"
Height = 252
Index = 1
Left = 240
TabIndex = 18
Top = 648
Width = 3732
End
Begin VB.OptionButton optRePrint
Caption = "每次改变显示比例时都重新绘图"
Height = 252
Index = 0
Left = 240
TabIndex = 17
Top = 264
Width = 3300
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "%"
Height = 180
Left = 3720
TabIndex = 20
Top = 960
Width = 144
End
End
Begin VB.CommandButton cmdDefault
Caption = "预设值"
Height = 372
Left = 3648
TabIndex = 15
Top = 3504
Width = 972
End
Begin VB.CommandButton cmdNo
Caption = "取消"
Height = 372
Left = 2568
TabIndex = 5
Top = 3504
Width = 972
End
Begin VB.CommandButton cmdYes
Caption = "确定"
Height = 372
Left = 1512
TabIndex = 4
Top = 3504
Width = 972
End
Begin VB.Frame Frame1
Caption = "边界值"
Height = 1596
Left = 312
TabIndex = 6
Top = 216
Width = 4308
Begin VB.TextBox txtMargin
Alignment = 2 'Center
Height = 348
Index = 4
Left = 3048
TabIndex = 3
Top = 936
Width = 804
End
Begin VB.TextBox txtMargin
Alignment = 2 'Center
Height = 348
Index = 3
Left = 1008
TabIndex = 2
Top = 936
Width = 804
End
Begin VB.TextBox txtMargin
Alignment = 2 'Center
Height = 348
Index = 2
Left = 3048
TabIndex = 1
Top = 384
Width = 804
End
Begin VB.TextBox txtMargin
Alignment = 2 'Center
Height = 348
Index = 1
Left = 1008
TabIndex = 0
Top = 384
Width = 804
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "cm"
Height = 180
Index = 7
Left = 3888
TabIndex = 14
Top = 1008
Width = 204
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "cm"
Height = 180
Index = 6
Left = 1872
TabIndex = 13
Top = 984
Width = 204
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "右边界:"
Height = 180
Index = 3
Left = 2304
TabIndex = 12
Top = 1008
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "左边界:"
Height = 180
Index = 2
Left = 264
TabIndex = 11
Top = 1008
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "cm"
Height = 180
Index = 5
Left = 3888
TabIndex = 10
Top = 456
Width = 204
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "cm"
Height = 180
Index = 4
Left = 1872
TabIndex = 9
Top = 432
Width = 204
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "下边界:"
Height = 180
Index = 1
Left = 2304
TabIndex = 8
Top = 456
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "上边界:"
Height = 180
Index = 0
Left = 264
TabIndex = 7
Top = 456
Width = 720
End
End
End
Attribute VB_Name = "frmPrintSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdDefault_Click()
Dim i As Long
For i = 1 To 4
txtMargin(i).Text = "1.0"
Next
optRePrint(1).Value = True
txtZoom.Text = 100
End Sub
Private Sub cmdNo_Click()
Unload Me
End Sub
Private Sub cmdYes_Click()
Dim i As Long, s As String
For i = 1 To 4
s = txtMargin(i).Text
If Not IsNumeric(s) Or InStr(s, ",") > 0 Or Val(s) < 0 Or Val(s) > 10 Then
MsgBox "边界值请输入大于 0 并且不大于 10 的数值。"
txtMargin(i).SetFocus
Exit Sub
End If
Next
s = txtZoom.Text
If Not IsNumeric(s) Or InStr(s, ",") > 0 Or InStr(s, "-") > 0 Or Val(s) = 0 Or InStr(s, ".") Then
MsgBox "您输入的图片比例有误,请输入一个正整数。"
txtZoom.SelStart = 0
txtZoom.SelLength = Len(s)
txtZoom.SetFocus
Exit Sub
End If
frmPrintPreview.lngZoom = txtZoom.Text
frmPrintPreview.blnRePrint = optRePrint(0).Value
glngTopMargin = txtMargin(1).Text * 567
glngBottomMargin = txtMargin(2).Text * 567
glngLeftMargin = txtMargin(3).Text * 567
glngRightMargin = txtMargin(4).Text * 567
Unload Me
End Sub
Private Sub Form_Load()
txtMargin(1) = Format(glngTopMargin / 567, "0.0")
txtMargin(2) = Format(glngBottomMargin / 567, "0.0")
txtMargin(3) = Format(glngLeftMargin / 567, "0.0")
txtMargin(4) = Format(glngRightMargin / 567, "0.0")
txtZoom.Text = frmPrintPreview.lngZoom
If frmPrintPreview.blnRePrint Then optRePrint(0).Value = True Else optRePrint(1).Value = True
End Sub
Private Sub optRePrint_Click(Index As Integer)
txtZoom.Enabled = (Index = 1)
If Index = 0 Then txtZoom.Text = frmPrintPreview.lngZoom
End Sub
Private Sub txtMargin_GotFocus(Index As Integer)
txtMargin(Index).SelStart = 0
txtMargin(Index).SelLength = Len(txtMargin(Index).Text)
End Sub