frmCalibrarZoom.frm
3.66 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
VERSION 5.00
Begin VB.Form frmCalibrarZoom
BorderStyle = 3 'Fixed Dialog
Caption = "Calibrar Zoom"
ClientHeight = 2340
ClientLeft = 45
ClientTop = 435
ClientWidth = 2865
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2340
ScaleWidth = 2865
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdOk
Caption = "OK"
Height = 390
Left = 1695
TabIndex = 5
Top = 1845
Width = 1050
End
Begin VB.Frame Frame1
Caption = "Fator 1.1 a 10 "
Height = 1575
Left = 150
TabIndex = 0
Top = 180
Width = 2595
Begin VB.TextBox txtZoomMais
Height = 345
Left = 1575
MaxLength = 3
TabIndex = 2
Top = 900
Width = 765
End
Begin VB.TextBox txtZoomMenos
Height = 345
Left = 1575
MaxLength = 3
TabIndex = 1
Top = 435
Width = 750
End
Begin VB.Label Label2
Caption = "Zoom Menos"
Height = 285
Left = 210
TabIndex = 4
Top = 510
Width = 1230
End
Begin VB.Label Label1
Caption = "Zoom Mais"
Height = 285
Left = 210
TabIndex = 3
Top = 960
Width = 1230
End
End
End
Attribute VB_Name = "frmCalibrarZoom"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOK_Click()
If Me.txtZoomMenos.Text <> "" And Me.txtZoomMais.Text <> "" Then
Dim menos As Double
Dim mais As Double
menos = Me.txtZoomMenos.Text
' If CDbl(Me.txtZoomMenos.Text) >= 1.1 And CDbl(Me.txtZoomMenos.Text) <= 10 Then
' If CDbl(Me.txtZoomMais.Text) >= 1.1 And CDbl(Me.txtZoomMais.Text) <= 10 Then
Call WriteINI("MAPA", "ZOOM_MENOS", Replace(Me.txtZoomMenos.Text, ",", "."), App.path & "\CONTROLES\GEOSAN.INI")
Call WriteINI("MAPA", "ZOOM_MAIS", Replace(Me.txtZoomMais.Text, ",", "."), App.path & "\CONTROLES\GEOSAN.INI")
dblFatorZoomMenos = CDbl(Me.txtZoomMenos.Text)
dblFatorZoomMais = CDbl(Me.txtZoomMais.Text)
Unload Me
' Else
' MsgBox "Valores inválidos.", vbInformation, ""
' End If
' Else
' MsgBox "Valores inválidos.", vbInformation, ""
'
' End If
End If
End Sub
Private Sub Form_Load()
On Error GoTo Trata_Erro
Me.txtZoomMenos.Text = Replace(ReadINI("MAPA", "ZOOM_MENOS", App.path & "\CONTROLES\GEOSAN.ini"), ",", ".")
Me.txtZoomMais.Text = Replace(ReadINI("MAPA", "ZOOM_MAIS", App.path & "\CONTROLES\GEOSAN.ini"), ",", ".")
Trata_Erro:
End Sub
Private Sub txtZoomMais_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Or KeyAscii = 46 Or KeyAscii >= 48 And KeyAscii <= 57 Then
Else
KeyAscii = 0
End If
End Sub
Private Sub txtZoomMenos_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Or KeyAscii = 46 Or KeyAscii >= 48 And KeyAscii <= 57 Then
Else
KeyAscii = 0
End If
End Sub