Advertisement
jsbsan

Ejemplo Columnview

Apr 15th, 2014
1,780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 2.13 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Public Sub _new()
  4.  
  5. End
  6.  
  7. Public Sub Form_Open()
  8.   relleno()
  9. End
  10.  
  11.  
  12. Public Sub relleno()
  13.  
  14.    ColumnView1.columns.count = 3
  15.  
  16.    ColumnView1.Columns[0].Text = "Barajas"
  17.    ColumnView1.Columns[0].alignment = Align.Center
  18.    ColumnView1.Columns[1].Text = "Palos"
  19.    ColumnView1.Columns[1].alignment = Align.Right
  20.    ColumnView1.Columns[2].Text = "Valor"
  21.    ColumnView1.Columns[2].alignment = Align.left
  22.    ColumnView1.mode = Select.Single
  23.    ColumnView1.Header = 1
  24.    
  25.    
  26.    ColumnView1.Add("BarES", "Baraja Española", Picture.Load("rb.png"))
  27.    ColumnView1.Add("ReyesES", "Reyes", Picture.Load("rb.png"), "BarES")
  28.    ColumnView1.Add("CaballosES", "Caballos", Picture.Load("cb.png"), "BarES")
  29.    ColumnView1.Add("cb", "Bastos", Picture.Load("cb.png"), "CaballosES")
  30.    ColumnView1.Add("cc", "Copas", Picture.Load("cc.png"), "CaballosES")
  31.    ColumnView1.Add("co", "Oros", Picture.Load("co.png"), "CaballosES")
  32.    ColumnView1.Add("ce", "Espadas", Picture.Load("ce.png"), "CaballosES")
  33.    
  34.    
  35.    ColumnView1.Add("rb", "Bastos", Picture.Load("rb.png"), "ReyesES")
  36.    ColumnView1.Add("rc", "Copas", Picture.Load("rc.png"), "ReyesES")
  37.    ColumnView1.Add("ro", "Oros", Picture.Load("ro.png"), "ReyesES")
  38.    ColumnView1.Add("re", "Espadas", Picture.Load("re.png"), "ReyesES")  
  39.    
  40.    
  41.   'relleno datos
  42.  
  43.     ColumnView1["rb"][1] = "Basto"
  44.     ColumnView1["rb"][2] = "12"
  45.    
  46.     ColumnView1["rc"][1] = "Copa"
  47.     ColumnView1["rc"][2] = "12"
  48.    
  49.     ColumnView1["re"][1] = "Espada"
  50.     ColumnView1["re"][2] = "12"
  51.    
  52.     ColumnView1["ro"][1] = "Oro"
  53.     ColumnView1["ro"][2] = "12"
  54.    
  55.     ColumnView1["cb"][1] = "Basto"
  56.     ColumnView1["cb"][2] = "11"
  57.    
  58.     ColumnView1["cc"][1] = "Copa"
  59.     ColumnView1["cc"][2] = "11"
  60.    
  61.     ColumnView1["ce"][1] = "Espada"
  62.     ColumnView1["ce"][2] = "11"
  63.    
  64.     ColumnView1["co"][1] = "Oro"
  65.     ColumnView1["co"][2] = "11"
  66.      
  67. End
  68.  
  69. Public Sub ColumnView1_Click()
  70.  
  71.   LabelDatoElegido.text = "Key: " & ColumnView1.Current.key & " Palo: " & ColumnView1[ColumnView1.Current.key][1] & " Valor: " & ColumnView1[ColumnView1.Current.key][2]
  72.  
  73. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement