Advertisement
jsbsan

CodigoFuente

Apr 7th, 2014
1,776
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 1.73 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Public ListaObjetos As New Object[]
  4.  
  5. Public Sub _new()
  6.  
  7. End
  8.  
  9. Public Sub Form_Open()
  10.  
  11.   Me.center 'centra el formulario en la pantalla
  12.  
  13. End
  14.  
  15. Public Sub PictureBoxHuevos_MouseDown()
  16.  
  17.   Dim PictureBoxTMP As Picturebox
  18.  
  19.   PictureBoxTMP = New Picturebox(HPanelMochila) As "ObjetosEnMochila"
  20.   PictureBoxTMP.Picture = Picture["huevos.jpg"]
  21.   PictureBoxTMP.Stretch = True
  22.   PictureBoxTMP.w = 60
  23.   PictureBoxTMP.h = 60
  24.   PictureBoxTMP.tag = "Huevos nº " & Str(Int(Rnd(1, 1000))) 'idnombre 'no sirve para identificar al objeto
  25.  
  26.   ListaObjetos.add(PictureBoxTmp)
  27.  
  28. End
  29.  
  30. Public Sub PictureBoxPan_MouseDown()
  31.  
  32.   Dim PictureBoxTMP As Picturebox
  33.  
  34.   PictureBoxTMP = New Picturebox(HPanelMochila) As "ObjetosEnMochila"
  35.   PictureBoxTMP.Picture = Picture["pan.jpg"]
  36.   PictureBoxTMP.Stretch = True
  37.   PictureBoxTMP.w = 70
  38.   PictureBoxTMP.h = 70
  39.   PictureBoxTMP.tag = "Pan nº " & Str(Int(Rnd(1, 1000))) 'idnombre 'no sirve para identificar al objeto
  40.  
  41.   ListaObjetos.add(PictureBoxTmp)
  42.  
  43. End
  44.  
  45. Public Sub PictureBoxChuleta_MouseDown()
  46.  
  47.   Dim PictureBoxTMP As Picturebox
  48.  
  49.   PictureBoxTMP = New Picturebox(HPanelMochila) As "ObjetosEnMochila"
  50.   PictureBoxTMP.Picture = Picture["chuleta.png"]
  51.   PictureBoxTMP.Stretch = True
  52.   PictureBoxTMP.w = 80
  53.   PictureBoxTMP.h = 80
  54.   PictureBoxTMP.tag = "Chuleta nº " & Str(Int(Rnd(1, 1000))) 'idnombre 'no sirve para identificar al objeto
  55.  
  56.   ListaObjetos.add(PictureBoxTmp)
  57.  
  58.   HPanelMochila.Refresh
  59.  
  60. End
  61.  
  62. Public Sub ObjetosEnMochila_MouseDown()
  63.   'Al pulsar el boton del raton, se muestra información del ultimo objeto que esta observador por "ObjetosEnMochila"
  64.   LabelObjetoSeleccionado.text = "Objeto seleccionado: " & Last.tag
  65.  
  66. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement