Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/02/2006, 21:38
LeandroA
 
Fecha de Ingreso: abril-2005
Mensajes: 351
Antigüedad: 19 años, 1 mes
Puntos: 3
Solucionado , ya me havia puesto los pelos de punta

quedo asi:
Cita:
Option Explicit
Private Sub Form_Load()
Dim i As Integer
Me.Show
Cmd(0).Visible = False
For i = 1 To 10
Load Cmd(i)
Cmd(i).Visible = True
Cmd(i).Caption = i
Next
Comprovar
End Sub
Sub Comprovar()
Dim i As Integer, x As Integer
For i = 1 To Cmd.UBound
If Existe(i) Then
x = x + 1
Alinear i, Cmd(0).Width * (x - 1)
End If
Next
End Sub
Sub Alinear(Index As Integer, XLeft As Long)
Cmd(Index).Left = XLeft
End Sub
Private Sub Cmd_Click(Index As Integer)
Unload Cmd(Index)
Comprovar
End Sub
Private Function Existe(Index As Integer) As Boolean
On Error GoTo NoExiste
If Cmd(Index).Visible = True Then Existe = True
Exit Function
NoExiste:
Existe = False
End Function
Private Sub ComAgregar_Click()
Load Cmd(Cmd.UBound + 1)
Cmd(Cmd.UBound).Visible = True
Cmd(Cmd.UBound).Caption = Cmd.UBound
Comprovar
End Sub