Работать в приводимом тобой коде абсолютно нечему. Да и идея там не видна.
Постарайтесь объяснить нужное понятным всем языком
Dim LabelI As Integer
Function prossMass(lengthM As Integer, text As Object, comm As Object)
LabelI = Command2.UBound
If LabelI = lengthM Then
Exit Function
Else
If LabelI > lengthM Then
LabelI = Command2.UBound
Unload Command2(LabelI)
LabelI = Command2.UBound
Unload Command2(LabelI)
LabelI = Text2.UBound
Unload Text2(LabelI)
Else
LabelI = Command2.UBound
Load Command2(LabelI + 1)
Command2(LabelI + 1).Top = Command2(LabelI).Top + Command2(LabelI).Height + 5
Command2(LabelI + 1).Left = Command2(LabelI).Left
Command2(LabelI + 1).Visible = True
LabelI = Text2.UBound
Load Text2(LabelI + 1)
Text2(LabelI + 1).Top = Text2(LabelI).Top + Text2(LabelI).Height + 3
Text2(LabelI + 1).Left = Text2(LabelI).Left
Text2(LabelI + 1).Visible = True
Text2(LabelI + 1).text = ""
End If
End If
End Function
Private Sub Command1_Click()
a = prossMass(Text1.text, Text2(), Command2())
End Sub
Private Sub Command4_Click()
a = prossMass(Text1.text, Text3(), Command3())
End Sub
Function prossMass(lengthM As Integer, nText As Object, nCommand As Object)
Dim i As Integer
If nText.ubound > 0 Then
For i = 1 To nText.ubound
nText(i).Visible = False
nCommand(i).Visible = False
Unload nText(i)
Unload nCommand(i)
Next
End If
For i = 1 To lengthM
Load nText(i)
Load nCommand(i)
nText(i).Top = nText(i - 1).Top + nText(i - 1).Height + 3
nText(i).Visible = True
nCommand(i).Top = nCommand(i - 1).Top + nCommand(i - 1).Height + 5
nCommand(i).Visible = True
Next
End Function
Private Sub Command1_Click()
a = prossMass(Text1.text, Text2, Command2)
End Sub
Private Sub Command4_Click()
a = prossMass(Text1.text, Text3(), Command3())
End Sub
Private Sub Form_Load()
ScaleMode = vbPixels
End Sub
Сейчас этот форум просматривают: Yandex-бот и гости: 129