Lo primero que hacemos es definir una nueva clase en nuestro proyecto Ej. ClassComboMultiple, el cual tiene un value y una descripción (adjunto el codigo):
Public Class ClassComboMultiple
Public Value As Object
Public Description As String
Public Sub New(ByVal NewValue As Object, ByVal NewDescription As String)
Value = NewValue
Description = NewDescription
End Sub
Public Overrides Function ToString() As String
Return Description
End Function
End Class
Una vez armado esto (en mi caso los valores son obtenidos de una tabla de un sqlce) solo tenemos que cargar los datos:
vL_ConexionMobil = New SqlCeConnection(vL_ArchivoMobil)
StrSql = "Select * from " & NombreTabla
MobilDataAdapter = New SqlCeDataAdapter(StrSql, vL_ConexionMobil)
Dim MobilTable As New DataTable
MobilDataAdapter.Fill(MobilTable)
For Each row As DataRow In MobilTable.Rows
FrmVenta.ComboBox1.Items.Add(New ClassComboMultiple(row.Item("Codigo"), row.Item("Razon").ToString))
Next
Y listo esto cargara en nuestro combo box los datos.
Para mostrar el dato seleccionado solo debemos hacer:
Me.CodigoCliente = CType(ComboBox1.SelectedItem, ClassComboMultiple).Value
Espero que les sirva.
What's Taking place i am new to this, I stumbled upon this I have discovered It absolutely helpful and it has aided me out loads. I hope to give a contribution & help other users like its aided me. Great job.
ResponderEliminarReview my blog post - chestfatburner.com
Fantastic goods from you, man. I've be mindful your stuff previous to and you're simply too great.
ResponderEliminarI actually like what you have obtained right here, really like what you're saying and the best way through which you say it. You are making it enjoyable and you continue to care for to keep it wise. I cant wait to learn much more from you. That is really a great website.
Also visit my blog post Unwanted effects associated with androgen hormone or the male growth hormone products – Gynecomastia
Hello, I log on to your blogs regularly. Your story-telling style is
ResponderEliminarwitty, keep it up!
my page Building Interior Upper body?
You can certainly see your expertise in the
ResponderEliminarwork you write. The arena hopes for more passionate
writers like you who are not afraid to say how they
believe. Always go after your heart.
my weblog: Alternative Treatments With Regard To Gynecomastia
I have been browsing on-line more than three hours these days, but I never discovered
ResponderEliminarany attention-grabbing article like yours. It is pretty worth sufficient
for me. In my opinion, if all webmasters and bloggers made excellent content material as
you did, the web shall be much more helpful than ever before.
My blog; So how exactly does doing exercises impact parts of muscle tissue ?
If you would like to take a good deal from this article then you have to apply such methods to
ResponderEliminaryour won weblog.
Here is my weblog ... Types of Gynecomastia
Hi colleagues, nice article and fastidious arguments commented here, I am in fact enjoying by these.
ResponderEliminarAlso visit my page ... The particular results associated with gynecomastia