¿Cómo puedo optimizar el siguiente código?
Código:
Lo he intentado por esta vía y unas cuantas más, pero me da error:Private Sub Command1_Click(Index As Integer) If Index = 1 Then Form1.Show Form1.Left = Me.Left Form1.Top = Me.Top ElseIf Index = 2 Then Form2.Show Form2.Left = Me.Left Form2.Top = Me.Top ElseIf Index = 3 Then Form3.Show Form3.Left = Me.Left Form3.Top = Me.Top 'y así un montón más de formularios End If End Sub
Código:
Gracias de antemano.Dim i as Integer For i = 1 to 20 Index(i) = Form& (i).show Next i
Un saludo