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
miércoles, 8 de septiembre de 2010
lunes, 6 de septiembre de 2010
viernes, 3 de septiembre de 2010
jueves, 2 de septiembre de 2010
PRACTICA EXCEL 8vo. A-B
martes, 31 de agosto de 2010
SOLUCION DEL EXAMEN SEGUNDO A-B
Private Sub CommandButton1_Click()
If ComboBox1.ListIndex = 0 Then
TextBox3 = Val(TextBox1) + Val(TextBox2)
Else
If ComboBox1.ListIndex = 1 Then
TextBox3 = Val(TextBox1) - Val(TextBox2)
Else
If ComboBox1.ListIndex = 2 Then
TextBox3 = Val(TextBox1) * Val(TextBox2)
Else
If ComboBox1.ListIndex = 3 Then
TextBox3 = Val(TextBox1) / Val(TextBox2)
Else
If ComboBox1.ListIndex = 4 Then
TextBox3 = Val(TextBox1) ^ Val(TextBox2)
End If
End If
End If
End If
End If
ListBox1.AddItem TextBox3
End Sub
Private Sub CommandButton2_Click()
End
End Sub
Private Sub CommandButton3_Click()
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
End Sub
Private Sub CommandButton4_Click()
If ListBox1.ListIndex = 0 Then
ListBox1.RemoveItem 0
Else
If ListBox1.ListIndex = 1 Then
ListBox1.RemoveItem 1
Else
If ListBox1.ListIndex = 2 Then
ListBox1.RemoveItem 2
Else
If ListBox1.ListIndex = 3 Then
ListBox1.RemoveItem 3
Else
ListBox1.RemoveItem 4
End If
End If
End If
End If
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "SUMA"
ComboBox1.AddItem "RESTA"
ComboBox1.AddItem "MULTIPLICACION"
ComboBox1.AddItem "DIVISION"
ComboBox1.AddItem "POTENCIA"
End Sub
domingo, 29 de agosto de 2010
miércoles, 11 de agosto de 2010
viernes, 28 de mayo de 2010
PREGUNTA DE EXAMEN PARA PRIMEROS SEC
miércoles, 26 de mayo de 2010
SOLUCION DE EXAMEN PARA SEGUNDO A-B
Suscribirse a:
Entradas (Atom)