Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Gambas class file
- Public ListaObjetos As New Object[]
- Public Sub _new()
- End
- Public Sub Form_Open()
- Me.center 'centra el formulario en la pantalla
- End
- Public Sub PictureBoxHuevos_MouseDown()
- Dim PictureBoxTMP As Picturebox
- PictureBoxTMP = New Picturebox(HPanelMochila) As "ObjetosEnMochila"
- PictureBoxTMP.Picture = Picture["huevos.jpg"]
- PictureBoxTMP.Stretch = True
- PictureBoxTMP.w = 60
- PictureBoxTMP.h = 60
- PictureBoxTMP.tag = "Huevos nº " & Str(Int(Rnd(1, 1000))) 'idnombre 'no sirve para identificar al objeto
- ListaObjetos.add(PictureBoxTmp)
- End
- Public Sub PictureBoxPan_MouseDown()
- Dim PictureBoxTMP As Picturebox
- PictureBoxTMP = New Picturebox(HPanelMochila) As "ObjetosEnMochila"
- PictureBoxTMP.Picture = Picture["pan.jpg"]
- PictureBoxTMP.Stretch = True
- PictureBoxTMP.w = 70
- PictureBoxTMP.h = 70
- PictureBoxTMP.tag = "Pan nº " & Str(Int(Rnd(1, 1000))) 'idnombre 'no sirve para identificar al objeto
- ListaObjetos.add(PictureBoxTmp)
- End
- Public Sub PictureBoxChuleta_MouseDown()
- Dim PictureBoxTMP As Picturebox
- PictureBoxTMP = New Picturebox(HPanelMochila) As "ObjetosEnMochila"
- PictureBoxTMP.Picture = Picture["chuleta.png"]
- PictureBoxTMP.Stretch = True
- PictureBoxTMP.w = 80
- PictureBoxTMP.h = 80
- PictureBoxTMP.tag = "Chuleta nº " & Str(Int(Rnd(1, 1000))) 'idnombre 'no sirve para identificar al objeto
- ListaObjetos.add(PictureBoxTmp)
- HPanelMochila.Refresh
- End
- Public Sub ObjetosEnMochila_MouseDown()
- 'Al pulsar el boton del raton, se muestra información del ultimo objeto que esta observador por "ObjetosEnMochila"
- LabelObjetoSeleccionado.text = "Objeto seleccionado: " & Last.tag
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement