; If i < 0 Then i = AddControl(FormControl, pfrmIn.Name) End If
Next FormControl
End Function
Function FindControl(inControl As Control, inName As String) As Long
Dim i As Long FindControl = -1
For i = 0 To (MaxControl - 1)
If ControlRecord(i).Parrent = inName Then If ControlRecord(i).Name = inControl.Name Then On Error Resume Next
If ControlRecord(i).Index = inControl.Index Then FindControl = i Exit Function End If
On Error GoTo 0 End If
End If
Next i
End Function
Function AddControl(inControl As Control, inName As String) As Long
ReDim Preserve ControlRecord(MaxControl + 1) On Error Resume Next ControlRecord(MaxControl).Name = inControl.Name ControlRecord(MaxControl).Index = inControl.Index ControlRecord(MaxControl).Parrent = inName
If TypeOf inControl Is Line Then ControlRecord(MaxControl).Top = inControl.Y1 ControlRecord(MaxControl).Left = ActualPos(inControl.X1) ControlRecord(MaxControl).Height = inControl.Y2 ControlRecord(MaxControl).Width = ActualPos(inControl.X2) Else ControlRecord(MaxControl).Top = inControl.Top ControlRecord(MaxControl).Left = ActualPos(inControl.Left) ControlRecord(MaxControl).Height = inControl.Height ControlRecord(MaxControl).Width = inControl.Width End If
inControl.IntegralHeight = False On Error GoTo 0 AddControl = MaxControl MaxControl = MaxControl + 1 End Function
Function PerWidth(pfrmIn As Form) As Long
Dim i As Long i = FindForm(pfrmIn)
If i < 0 Then i = AddForm(pfrmIn) End If
PerWidth = (pfrmIn.ScaleWidth * 100) \ FormRecord(i).ScaleWidth End Function
Function PerHeight(pfrmIn As Form) As Double
Dim i As Long i = FindForm(pfrmIn)
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页 没有相关教程
|