vb :请问各位大侠,以下代码每句都是什么意思呀.小弟才疏学浅,实在是不知道我.Private FormOldWidth As Long Private FormOldHeight As Long Public Sub resizeinit(FormName As Form) Dim Obj As Control FormOldWidth = FormName.Scal

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 09:21:26
vb:请问各位大侠,以下代码每句都是什么意思呀.小弟才疏学浅,实在是不知道我.PrivateFormOldWidthAsLongPrivateFormOldHeightAsLongPublicSubr

vb :请问各位大侠,以下代码每句都是什么意思呀.小弟才疏学浅,实在是不知道我.Private FormOldWidth As Long Private FormOldHeight As Long Public Sub resizeinit(FormName As Form) Dim Obj As Control FormOldWidth = FormName.Scal
vb :请问各位大侠,以下代码每句都是什么意思呀.小弟才疏学浅,实在是不知道我.
Private FormOldWidth As Long
Private FormOldHeight As Long
Public Sub resizeinit(FormName As Form)
Dim Obj As Control
FormOldWidth = FormName.ScaleWidth
FormOldHeight = FormName.ScaleHeight
On Error Resume Next
For Each Obj In FormName
Obj.Tag = Obj.Left & " " & Obj.Top & " " & Obj.Width & " " & Obj.Height & " "
Next Obj
On Error GoTo 0
End Sub
Public Sub ResizeForm(FormName As Form)
Dim Pos(4) As Double
Dim i As Long,TempPos As Long,StartPos As Long
Dim Obj As Control
Dim ScaleX As Double,ScaleY As Double
ScaleX = FormName.ScaleWidth / FormOldWidth
ScaleY = FormName.ScaleHeight / FormOldHeight
On Error Resume Next
For Each Obj In FormName
StartPos = 1
For i = 0 To 4
TempPos = InStr(StartPos,Obj.Tag," ",vbTextCompare)
If TempPos > 0 Then
Pos(i) = Mid(Obj.Tag,StartPos,TempPos - StartPos)
StartPos = TempPos + 1
Else
Pos(i) = 0
End If
Obj.Move Pos(0) * ScaleX,Pos(1) * ScaleY,Pos(2) * ScaleX,Pos(3) * ScaleY
Next i
Next Obj
On Error GoTo 0
End Sub
Private Sub Form_Resize()
Call ResizeForm(Me)
End Sub

vb :请问各位大侠,以下代码每句都是什么意思呀.小弟才疏学浅,实在是不知道我.Private FormOldWidth As Long Private FormOldHeight As Long Public Sub resizeinit(FormName As Form) Dim Obj As Control FormOldWidth = FormName.Scal
gxhbsx