-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormControl.bas
69 lines (46 loc) · 1.47 KB
/
FormControl.bas
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
Attribute VB_Name = "FormControl"
Public Sub ResizeControls_add(frm As Form)
Dim i As Integer
x_size_add = frm.height / iHeight_add
y_size_add = frm.width / iWidth_add
For i = 0 To UBound(list_add)
For Each curr_obj In frm
If list_add(i).support = "supported" Then
With curr_obj
.Left = list_add(i).Left * y_size_add
.width = list_add(i).width * y_size_add
.Top = list_add(i).Top * x_size_add
On Local Error GoTo Hata:
.height = list_add(i).height * x_size_add
Hata:
End With
End If
Next curr_obj
Next i
End Sub
Public Sub GetLocation_add(frm As Form)
Dim i As Integer
i = 0
For Each curr_obj In frm
ReDim Preserve list_add(i)
Select Case curr_obj.Name
Case "Timer1"
With list_add(i)
'.support = "unsupported"
End With
Case Else
With list_add(i)
.Index = curr_obj.TabIndex
.Left = curr_obj.Left
.Top = curr_obj.Top
.width = curr_obj.width
.height = curr_obj.height
.support = "supported"
End With
i = i + 1
End Select
Next curr_obj
' This is what the object sizes will be compared to on rescaling.
iHeight_add = frm.height
iWidth_add = frm.width
End Sub