Yal Publicidad
Web master: Yuri Lizama
www.yalpublicidad.com/blog/
Ingresar array en ComboBox de Visual Basic 6
Modulo 1
Option Explicit
Public Function AddCombo(xCombo As ComboBox, xDatos As String)
Dim xItems() As String
Dim I As Integer
xItems = Split(xDatos, ",")
For I = 0 To UBound( xItems)
xCombo.AddItem xItems(I)
Next I
Form1
Ingresar un ComboBox y CommandButton
Option Explicit
Private Sub CommandButton1_Click()
Dim xDatos As String
xDatos = "Dato1, Dato2, Dato3"
Call AddCombo (ComboBox1, xDatos)
End Sub
Web master: Yuri Lizama
www.yalpublicidad.com/blog/
Ingresar array en ComboBox de Visual Basic 6
Modulo 1
Option Explicit
Public Function AddCombo(xCombo As ComboBox, xDatos As String)
Dim xItems() As String
Dim I As Integer
For I = 0 To UBound( xItems)
xCombo.AddItem xItems(I)
Next I
End Function
Form1
Ingresar un ComboBox y CommandButton
Option Explicit
Private Sub CommandButton1_Click()
Dim xDatos As String
xDatos = "Dato1, Dato2, Dato3"
Call AddCombo (ComboBox1, xDatos)
End Sub
Comentarios
Publicar un comentario