Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/10/2011, 11:37
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: Crear ComboBox y TextBox desde VB6.0

Hola!
Aquí tienes un ejemplo de como hacerlo:

• Agrega un Textbox con indice en cero (txt)
• Agrega un Label con indice en cero (lbl)
• Agrega un Command (cmd)

Código vb:
Ver original
  1. Private Sub cmd_Click()
  2.     Dim IND As Integer
  3.    
  4. 'PARA EL LABEL
  5.    IND = lbl.UBound + 1
  6.    
  7.     Load lbl(IND)
  8.    
  9.     lbl(IND).Left = 120
  10.     lbl(IND).Top = lbl(IND - 1).Top + lbl(IND - 1).Height + 45
  11.     lbl(IND).Width = lbl(IND).Width
  12.     lbl(IND).Caption = "Indice: " & IND
  13.     lbl(IND).Visible = True
  14.    
  15. 'PARA EL TEXTBOX
  16.    IND = txt.UBound + 1
  17.    
  18.     Load txt(IND)
  19.    
  20.     txt(IND).Left = 2160
  21.     txt(IND).Top = txt(IND - 1).Top + txt(IND - 1).Height + 45
  22.     txt(IND).Width = txt(IND).Width
  23.     txt(IND).Text = "Indice: " & IND
  24.     txt(IND).Visible = True
  25.    
  26. 'PARA EL COMMAND
  27.    cmd.Top = txt(IND).Top + txt(IND).Height + 45
  28.    
  29. 'PARA LA FORMA
  30.    If Me.WindowState = 0 Then If cmd.Top >= 2580 Then Me.Height = Me.Height + cmd.Height
  31. End Sub

Nos cuentas!!