Posted By

Maikel on 05/04/11


Tagged

enum


Versions (?)

Bind Enum to Combobox


 / Published in: VB.NET
 

  1. Dim query = From n As Integer In [Enum].GetValues(GetType(DialogResult))
  2. Select New With {n, .Valor = [Enum].GetName(GetType(DialogResult), n)}
  3.  
  4. ComboBox1.DataSource = query.ToList()
  5. ComboBox1.DisplayMember = "Valor"
  6. ComboBox1.ValueMember = "n"

Report this snippet  

You need to login to post a comment.