lunes, 4 de octubre de 2010
PROGRAMA PARA JUGAR CACHO EN VISUAL BASIC
Private Sub CommandButton1_Click()
'***** GENERA 5 NUMEROS ALEATORIOS ******
N1 = Int((Rnd * 6)) + 1
N2 = Int((Rnd * 6)) + 1
N3 = Int((Rnd * 6)) + 1
N4 = Int((Rnd * 6)) + 1
N5 = Int((Rnd * 6)) + 1
'***** ASIGNA A LAS ETIQUETAS ******
Label1.Caption = N1
Label2.Caption = N2
Label3.Caption = N3
Label4.Caption = N4
Label5.Caption = N5
' SELECCIONA LA IMAGEN DE ACUERDO AL NUMERO OBTENIDO ******
' PARA LOS CINDO DADOS, HAY CINCO SELECT CASE
Select Case N1
Case 1
Image1.Picture = LoadPicture("c:\cacho\d1.bmp")
Case 2
Image1.Picture = LoadPicture("c:\cacho\d2.bmp")
Case 3
Image1.Picture = LoadPicture("c:\cacho\d3.bmp")
Case 4
Image1.Picture = LoadPicture("c:\cacho\d4.bmp")
Case 5
Image1.Picture = LoadPicture("c:\cacho\d5.bmp")
Case 6
Image1.Picture = LoadPicture("c:\cacho\d6.bmp")
End Select
Select Case N2
Case 1
Image2.Picture = LoadPicture("c:\cacho\d1.bmp")
Case 2
Image2.Picture = LoadPicture("c:\cacho\d2.bmp")
Case 3
Image2.Picture = LoadPicture("c:\cacho\d3.bmp")
Case 4
Image2.Picture = LoadPicture("c:\cacho\d4.bmp")
Case 5
Image2.Picture = LoadPicture("c:\cacho\d5.bmp")
Case 6
Image2.Picture = LoadPicture("c:\cacho\d6.bmp")
End Select
Select Case N3
Case 1
Image3.Picture = LoadPicture("c:\cacho\d1.bmp")
Case 2
Image3.Picture = LoadPicture("c:\cacho\d2.bmp")
Case 3
Image3.Picture = LoadPicture("c:\cacho\d3.bmp")
Case 4
Image3.Picture = LoadPicture("c:\cacho\d4.bmp")
Case 5
Image3.Picture = LoadPicture("c:\cacho\d5.bmp")
Case 6
Image3.Picture = LoadPicture("c:\cacho\d6.bmp")
End Select
Select Case N4
Case 1
Image4.Picture = LoadPicture("c:\cacho\d1.bmp")
Case 2
Image4.Picture = LoadPicture("c:\cacho\d2.bmp")
Case 3
Image4.Picture = LoadPicture("c:\cacho\d3.bmp")
Case 4
Image4.Picture = LoadPicture("c:\cacho\d4.bmp")
Case 5
Image4.Picture = LoadPicture("c:\cacho\d5.bmp")
Case 6
Image4.Picture = LoadPicture("c:\cacho\d6.bmp")
End Select
Select Case N5
Case 1
Image5.Picture = LoadPicture("c:\cacho\d1.bmp")
Case 2
Image5.Picture = LoadPicture("c:\cacho\d2.bmp")
Case 3
Image5.Picture = LoadPicture("c:\cacho\d3.bmp")
Case 4
Image5.Picture = LoadPicture("c:\cacho\d4.bmp")
Case 5
Image5.Picture = LoadPicture("c:\cacho\d5.bmp")
Case 6
Image5.Picture = LoadPicture("c:\cacho\d6.bmp")
End Select
End Sub
Suscribirse a:
Enviar comentarios (Atom)
PARIENTE PODEJ TRADUCIR ESO EN VISUAL
ResponderEliminarCOMO PROGRAMITA