Bueno... Quería compartir con ustedes unos
trabajos
que hice con amigos... No serán buenos( pueden mejorarlos), jaja pero los comparto con ustedes... Si alguien tiene el
Visual
claro...
Estos trabajos me los hicieron hacer para la escuela, hay de todo tipo.
Aca les dejo la explicación del Drag&Drop : ( Los Rem, son comentarios y va diciendo lo que sucedeo lo que es)
-Conceptos Básicos de Drag
Rem este Procedimiento se activa cuando movemos un objeto con el Mouse sobre el Formulario
Rem Se arrastra y suelta algún objeto cuya propiedad DragMode esta en 1
Rem Source es cualquier objeto que pueda ser arrastrado en este caso sobre el formulario, por ejemplo Source en este caso remplaza al Label1, Label2, etc
Rem X e Y representan la coordenada Horizontal y Vertical actual del puntero del Mouse
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Rem move ubica horizontalmente y verticalmente a un objeto
Rem es equivalente a utilizar el Left y luego el Top
Source.Move X, Y
End Sub
Private Sub Form_Load()
Label1.Caption = ""
Label1.BackColor = vbRed
Label1.DragMode = 1
Label2.Caption = ""
Label2.BackColor = vbBlue
Label2.DragMode = 1
End Sub
Un objeto (Image1) aparece en cualquier lugar al azar de un formulario maximizado, lo desplazamos hasta otro sitio cualquiera, y al soltar el botón izquierdo del Mouse, sale un mensaje que dice Volver al lugar de origen y al aceptar, el objeto arrastrado inmediatamente retorna a su posición original.
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Image1.Move X, Y
MsgBox "Volver al lugar de origen"
Image1.Move Label1.Left, Label1.Top
End Sub
Private Sub Form_Load()
Label1.Visible = False
Image1.DragMode = 1
Form1.WindowState = 2
End Sub
Private Sub Form_Resize()
Randomize
Image1.Move (Form1.Width - Image1.Width) * Rnd, (Form1.Height - Image1.Height) * Rnd
Rem utilizo Label1 como un objeto auxiliar para poder almacenar (recorder) en este caso la
Rem posicion que tenia la Imagen antes de ser movida
Label1.Left = Image1.Left
Label1.Top = Image1.Top
End Sub
-------------------------------------------------------------------------------
Les voy dejando el nombre que tienen y despues los objetos que se necesitan para que funcione y por último lo más importante: Los códigos .
Un buscaminas como el juego de INICIO, pero con ceros...
Objetos requeridos:
- Label1 ( 23 matrices), es decir, 22 labels1 más, ya que el cero se cuenta como uno. Esto lo pueden hacer así : Copian el Label1, control + c , y luego ponen control + v , les aparecerá un cartel que dice algo asi como si desean crear una Matriz de controles, ponen aceptar, y pegan los labels restantes.
- Label2 ( UNO SOLO )
- Dos imágenes( Una con cara buena, y otra con mala, esto es para que cuando salga un " 0 " se ponga la cara mala, y luego apretandola se reinicia el juego con una buena). La cara mala debe ser la Image1 ( es decir la primer Image) , y la cara buena debe ser la Image2 ( es decir, la segunda Image).
Código :
Private Sub Form_Load()
Form1.WindowState = 2
Form1.Caption = "Evitando los ceros"
For i = 0 To 23
Label1(i).BackColor = vbWhite
Label1(i).Caption = ""
Label1(i).BorderStyle = 1
Label1(i).Appearance = 0
Label1(i).Font = "arial"
Label1(i).FontSize = 50
Label1(i).Alignment = 2
Label1(i).ForeColor = RGB( 0 , 186, 100)
Next i
Label2.Caption = 0
Label2.BorderStyle = 1
Label2.Appearance = 0
Label2.Font = "arial"
Label2.FontSize = 50
Label2.Alignment = 2
Image2.Visible = True
Image1.Visible = False
End Sub
Private Sub Form_Resize()
Image2.Left = Form1.Width / 2 - Image2.Width / 2
Image2.Top = Label1( 0 ).Top
Image1.Left = Form1.Width / 2 - Image2.Width / 2
Image1.Top = Label1( 0 ).Top
Label2.Width = Form1.Width / 10
Label2.Height = Form1.Height / 10
Label2.Top = 0
Label2.Left = 0
For i = 0 To 23
Label1(i).Width = Form1.Width / 10
Label1(i).Height = Form1.Height / 10
Next i
Label1( 0 ).Top = Form1.Height / 6 - Label1( 0 ).Height / 6
Label1( 0 ).Left = Form1.Width / 3 - Label1( 0 ).Width / 3
For i = 1 To 3
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1( 0 ).Top
Next i
Label1(4).Top = Label1( 0 ).Top + Label1(4).Height
Label1(4).Left = Label1( 0 ).Left
For i = 5 To 7
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(4).Top
Next i
Label1(8).Top = Label1(4).Top + Label1(8).Height
Label1(8).Left = Label1(4).Left
For i = 9 To 11
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(8).Top
Next i
Label1(12).Top = Label1(8).Top + Label1(12).Height
Label1(12).Left = Label1(8).Left
For i = 13 To 15
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(12).Top
Next i
Label1(16).Top = Label1(12).Top + Label1(16).Height
Label1(16).Left = Label1(12).Left
For i = 17 To 19
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(16).Top
Next i
Label1(20).Top = Label1(16).Top + Label1(20).Height
Label1(20).Left = Label1(16).Left
For i = 21 To 23
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(20).Top
Next i
End Sub
Private Sub Image1_Click()
Form_Load
End Sub
Private Sub Image2_Click()
Form_Load
End Sub
Private Sub Label1_Click(Index As Integer)
Randomize
For i = 0 To 23
Label1(Index).Caption = Int(9 * Rnd)
Next i
Label2.Caption = Val(Label2.Caption) + Val(Label1(Index))
If Label1(Index).Caption = 0 Then
For i = 0 To 23
Label1(i).Caption = Int(9 * Rnd)
Next i
Image2.Visible = False
Image1.Visible = True
End If
End Sub
------------------------------------------------------------------------------------------------------------------------------------------------------------
Un trabajo original, JEJEJEJE de Naves ( en este trabajo se cumple algo muy importante la función de choques... entre objetos ) ( CON LAS FLECHITAS SE MUEVE, Y DISPARA CON SPACE)
Objetos Requeridos:
- Image1 ( Es la imagen de una nave, queda mejor una de fondo negro, pero funciona con cualquier imagen igual).
- Image2 ( UN MISÍL, que será el que impacte con la Image2 ( la nave).
- 5 timers, es decir : Timer1 , Timer2 , Timer3 , Timer4 , Timer5 .
Código :
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then
Image2.Left = Image2.Left + 100
End If
If KeyCode = vbKeyLeft Then
Image2.Left = Image2.Left - 100
End If
If KeyCode = vbKeySpace Then
Timer3.Enabled = True
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 30
Timer2.Enabled = False
Timer2.Interval = 30
Timer3.Enabled = False
Timer3.Interval = 10
Form1.BackColor = vbBlack
Form1.KeyPreview = True
Form1.WindowState = 2
Timer4.Enabled = True
Timer4.Interval = 30
Timer5.Enabled = False
Timer5.Interval = 30
End Sub
Private Sub Form_Resize()
Image2.Top = Form1.Height / 1 - Image2.Height / 1
Image2.Left = Form1.Width / 2 - Image2.Width / 2
End Sub
Private Sub Timer1_Timer()
Image1.Left = Image1.Left + 120
If Image1.Left >= Form1.Width - Image1.Width Then
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Image1.Left = Image1.Left - 135
If Image1.Left <= 0 Then
Timer2.Enabled = False
Timer1.Enabled = True
End If
End Sub
Private Sub Timer3_Timer()
Image2.Top = Image2.Top - 135
If Image2.Top <= 0 Then
Timer3.Enabled = False
Form_Resize
MsgBox "¡Le erraste a la nave!"
Timer3.Enabled = False
End If
If Image2.Left >= Image1.Left And Image2.Left <= Image1.Left + Image1.Width - Image2.Width And Image2.Top >= Image1.Top And Image2.Top <= Image1.Height + Image1.Top - Image2.Height Then
MsgBox "¡La Nave ha sido destruida!"
Timer3.Enabled = False
End If
If Image2.Left >= Image1.Left And Image2.Left <= Image1.Left + Image1.Width - Image2.Width And Image2.Top >= Image1.Top And Image2.Top <= Image1.Height + Image1.Top - Image2.Height Then
Image2.Top = Form1.Height / 1 - Image2.Height / 1
Image2.Left = Form1.Width / 2 - Image2.Width / 2
End If
End Sub
Private Sub Timer4_Timer()
Image2.Left = Image2.Left + 75
If Image2.Left >= Form1.Width - Image2.Width Then
Timer4.Enabled = False
Timer5.Enabled = True
End If
End Sub
Private Sub Timer5_Timer()
Image2.Left = Image2.Left - 75
If Image2.Left <= 0 Then
Timer5.Enabled = False
Timer4.Enabled = True
End If
End Sub
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Aquí el mejor trabajo que hice... Y el más pesado, el que tiene más cosas, pero la verdad que vale mucho la pena.
Objetos Requeridos :
-Label1 ( Crear Matriz, copiar Label1 y hacer 120 labels1 ).
-Label2( uno solo está bien).
-Label3 ( Otra matriz pero esta vez crear solo 11 labels3, y ahora les digo que nombre le deben poner).
Va a haber un Label3 que va a quedar con ese (Nombre) , pero luego a otro Label3 que seguramente aparecera algo como así Label3( 0 o 1, o 2 ) el numero que sea, le ponen subss. Hago una lista mejor.
En la barra de propiedades un espacio se llamará o dirá ( Nombre ) : lo cambiarán por el que les diga.
A un Label3 lo dejan como está, es decir con el nombre de Label3
A otro le ponen subss en la barra de Propiedades ( Nombre).
A otro le ponen polar en la barra de Propiedades ( Nombre).
A otro le ponen frioocea en la barra de Propiedades ( Nombre).
A otro le ponen tempconti en la barra de Propiedades ( Nombre).
A otro le ponen continental en la barra de Propiedades ( Nombre).
A otro le ponen tempocea en la barra de Propiedades ( Nombre).
A otro le ponen temptransi en la barra de Propiedades ( Nombre).
A otro le ponen altura en la barra de Propiedades ( Nombre).
A otro le ponen subcs en la barra de Propiedades ( Nombre).
A otro le ponen desertico en la barra de Propiedades ( Nombre).
ESTOS SON LOS CLIMAS .
- Command1 ( esto es un objeto de comando )
- Timer1 y Timer2 ( Dos timers esta bien)
- Image1 ( La imagen de los climas de América del Norte en un mapa) Lo pueden copiar desde acá así tienen el que más va :
Copian esa Imágen, y en el Visual apretan en Image, y la imagen que copiaron la pegan en el espacio de la Image1.
Esa imagen en Propiedades le ponen Stretch True( quiere decir que se adapte cuando la moves de su tamaño)
Código :
Private Sub Form_Load()
Form1.Caption = " Climas de America del Norte"
Form1.WindowState = 2
For i = 0 To 120
Label1(i).Visible = True
Label1(i).Caption = ""
Label1(i).BorderStyle = 0
Label1(i).BackStyle = 0
Next i
Label3.Visible = False
Label3.ForeColor = vbRed
Label3.BackColor = vbBlack
Label3.BorderStyle = 1
Label3.FontSize = 32
Label3.Font = "arial"
Label3.Caption = "Pasá el mouse por las distintas partes de América del norte para enterarte de su clima y sus caracteristicas, muchas gracias."
Label2.Visible = False
Rem label 2 especifica en que label esta parado el mouse
Label2.ForeColor = vbRed
Label2.FontSize = 24
Rem polar es el label que representa el frio polar
polar.Visible = False
polar.ForeColor = vbWhite
polar.BackColor = RGB(120, 20, 150)
polar.BorderStyle = 1
polar.FontSize = 15
polar.Font = "arial"
polar.Caption = "El clima polar está caracterizado por tener casi permanentemente temperaturas por debajo de 0 ºC; y las precipitaciones son muy escasas. La humedad relativa en el aire es muy baja y el viento suele ser bastante intenso, lo que hace aún más hostiles las condiciones de vida en este clima.Las precipitaciones son escasas, inferiores a 250-300 mm al año, debido a la presencia permanente de anticiclones, y caen habitualmente en forma de nieve.Las aguas solo se encuentran en estado líquido en las zonas donde la temperatura sube de 0 ºC."
Rem continental es el label que representa el frio continental
continental.Visible = False
continental.BackColor = RGB( 0 , 110, 255)
continental.BorderStyle = 1
continental.FontSize = 15
continental.ForeColor = vbWhite
continental.Font = "arial"
continental.Caption = "Clima continental es conocido así al clima riguroso en donde las diferencias de temperaturas entre invierno y verano son enormes, así mismo con el día y la noche, los veranos son calientes y los inviernos muy fríos, siempre hay heladas en invierno (por alcanzar temperaturas bajo 0°C) y por lo general lluvias escasas, estas características se producen por localizarse en el interior de los continentes o por regiones aisladas por cadenas montañas que impide la influencia marítima."
Rem altura es el label que representa el frio de altura
altura.Visible = False
altura.BackColor = RGB(100, 210, 255)
altura.BorderStyle = 1
altura.FontSize = 13
altura.ForeColor = RGB( 0 , 0 , 100)
altura.Font = "arial"
altura.Caption = "El clima de montaña es más frío y húmedo que el del llano, puesto que la temperatura desciende a un ritmo aproximado de 5º cada 1 km de altitud y las lluvias van aumentado con la altura.Las montañas Rocosas reciben una cantidad moderada de precipitaciones en forma de lluvia, sobre todo durante los meses de invierno. Las praderas cubren los niveles inferiores y dan paso a grandes bosques de coníferas. Por encima de la zona arbolada se extienden pastizales y arbustos aislados. Las cimas de los picos tienen escasa vegetación y algunos están cubiertos de nieve y hielo durante todo el año."
Rem subss es el label que representa el clima de subtropical sin estacion seca
subss.Visible = False
subss.BackColor = RGB(170, 0 , 0 )
subss.BorderStyle = 1
subss.FontSize = 15
subss.ForeColor = vbWhite
subss.Font = "arial"
subss.Caption = "El clima subtropical sin estacion seca presenta lluvias abundantes y temperaturas del estilo del clima mediterráneo típico. Las precipitaciones oscilan entre los 500 y 1.200mm, siendo uno de sus principales aportes la denominada precipitación horizontal, dada por el mar de nubes o brumas, que son frecuentes en verano. La elevada humedad relativa es otra de las características, casi siempre superior al 70%. Las temperaturas no suelen bajar de los 12 °C en invierno ni superar los 30 °C en época estival. La vegetación más representativa y potencial de esta zona es el bosque húmedo o la laurisilva."
Rem frioocea representa el frio oceanico
frioocea.Visible = False
frioocea.BorderStyle = 1
frioocea.FontSize = 15
frioocea.ForeColor = vbWhite
frioocea.BackColor = RGB( 0 , 0 , 130)
frioocea.Font = "arial"
frioocea.Caption = "La temperatura de la estación más fría varia entre 0 y 5 grados y de la estación menos fría entre 8 y 10 grados.La humedad está dada por los vientos provenientes del anticiclón del Pacífico que descargan su humedad en el relieve.Las precipitaciones son abundantes, oscilan entre 1500 y 1800 milímetros anuales."
Rem tempocea representa el templado oceanico
tempocea.Visible = False
tempocea.BorderStyle = 1
tempocea.FontSize = 17
tempocea.ForeColor = RGB( 0 , 100, 0 )
tempocea.BackColor = RGB(190, 255, 150)
tempocea.Font = "arial"
tempocea.Caption = "Los Climas templados oceanicos se situan entre las latitudes de 45º y 55º. Están normalmente, al lado de los climas mediterráneos.Estos climas son dominantes a lo largo del año. Los veranos son frescos y nublados. Los inviernos son suaves, al contrario de otros climas , a una latitud semejante."
Rem subcs representa el clima subtropical con estacion seca
subcs.Visible = False
subcs.BorderStyle = 1
subcs.ForeColor = vbWhite
subcs.FontSize = 17
subcs.BackColor = vbRed
subcs.Caption = "Este clima se da entre los 25º y los 35º de latitud.En realidad no es otra cosa que una extensión hacia el norte del clima tropical seco, pero la precipitación es mayor y la amplitud térmica anual también. Está dominado por las masas de aire tropical continental, pero en las épocas en las que la posición relativa del sol es más baja pueden llegar masas de aire polar continental o marítimo."
subcs.Font = "arial"
Rem desertico representa el clima desertico
desertico.Visible = False
desertico.BorderStyle = 1
desertico.ForeColor = RGB(200, 100, 50)
desertico.FontSize = 14
desertico.BackColor = RGB(250, 200, 50)
desertico.Font = "arial"
desertico.Caption = "Clima desertico o arido.La temperatura media anual supera los 18ºC, y las temperaturas diarias presentan fuertes oscilaciones entre el día y la noche (20ºC o más).Las precipitaciones son muy escasas e irregulares, debido a la influencia permanente de anticiclones tropicales. En los bordes semiáridos del desierto, hay entre 750 y 150 mm anuales, y los meses áridos son más de siete.La vegetación del clima désertico es escasa, baja y dispersa. Deja extensas superficies sin cubrir, que están ocupadas por arena, piedras o rocas."
Rem tempconti representa el templado continental
tempconti.Visible = False
tempconti.BorderStyle = 1
tempconti.ForeColor = RGB( 0 , 100, 0 )
tempconti.FontSize = 16
tempconti.Font = "arial"
tempconti.BackColor = RGB(170, 255, 0 )
tempconti.Caption = "Este clima es propio de las regiones del interior de los continentes en latitudes superiores a 45º. Se caracteriza por una relativa escasez de lluvias, sobre todo en el inverno, debido a la distancia que las separa de las áreas de influencia marítima, y por una notable amplitud térmica estacional, con las temperaturas de verano bastante altas que contrastan fuertemente con los inviernos, muy frios. La temperatura media anual es inferior a 10 ºC."
Rem temptransi represant el templado de transicion
temptransi.Visible = False
temptransi.BorderStyle = 1
temptransi.ForeColor = vbWhite
temptransi.FontSize = 17
temptransi.BackColor = RGB( 0 , 100, 0 )
temptransi.Font = "arial"
temptransi.Caption = "Temperatura media anual 16ºC, en invierno, 9ºC y en verano, 22ºC. Las precipitaciones son cercanas a 700 mm., con veranos más lluviosos que los inviernos. Se ubican en zonas ubicadas entre las zonas oceánicas y continentales."
Timer1.Enabled = False
Timer1.Interval = 12000
Timer2.Enabled = False
Timer2.Interval = 6000
Rem instrucciones es el cartel de ayuda
instrucciones.Caption = "¡AYUDA!"
instrucciones.Appearance = 0
instrucciones.Font = "arial"
instrucciones.FontSize = 50
End Sub
Private Sub Form_Resize()
Rem ubico el label3( cartel de ayuda ) en el centro de la pantalla y le doy su tamaño
Label3.Height = Form1.Height / 2
Label3.Width = Form1.Width / 2
Label3.Top = Form1.Height / 2 - Label3.Height / 2
Label3.Left = Form1.Width / 2 - Label3.Width / 2
Rem ubico todos los labels y especifico su tamaño
polar.Width = Form1.Width / 4
polar.Height = Form1.Height / 1.7
polar.Top = Form1.Height / 1.8 - polar.Height / 2
polar.Left = 0
continental.Width = Form1.Width / 4
continental.Height = Form1.Height / 1.8
continental.Top = Form1.Height / 1. 6 - polar.Height / 2
continental.Left = 0
altura.Width = Form1.Width / 4
altura.Height = Form1.Height / 1.8
altura.Top = Form1.Height / 1. 6 - polar.Height / 2
altura.Left = 0
subcs.Width = Form1.Width / 4
subcs.Height = Form1.Height / 1. 6
subcs.Top = Form1.Height / 1.7 - polar.Height / 2
subcs.Left = 0
frioocea.Width = Form1.Width / 4
frioocea.Height = Form1.Height / 1.8
frioocea.Top = Form1.Height / 1.4 - polar.Height / 2
frioocea.Left = 0
subss.Width = Form1.Width / 4
subss.Height = Form1.Height / 1. 6
subss.Top = Form1.Height / 1.9 - polar.Height / 2
subss.Left = 0
temptransi.Width = Form1.Width / 4
temptransi.Height = Form1.Height / 1.8
temptransi.Top = Form1.Height / 1.4 - polar.Height / 2
temptransi.Left = 0
tempocea.Width = Form1.Width / 4
tempocea.Height = Form1.Height / 1.8
tempocea.Top = Form1.Height / 1.5 - polar.Height / 2
tempocea.Left = 0
tempconti.Width = Form1.Width / 4
tempconti.Height = Form1.Height / 1.8
tempconti.Top = Form1.Height / 1. 6 - polar.Height / 2
tempconti.Left = 0
desertico.Width = Form1.Width / 4
desertico.Height = Form1.Height / 1.7
desertico.Top = Form1.Height / 1.8 - polar.Height / 2
desertico.Left = 0
instrucciones.Left = 0
instrucciones.Top = Form1.Height / 1.16
Rem la matriz formada por 121 labels ayuda a formar zonas para indicar los climas
Image1.Top = 0
Image1.Left = 0
Image1.Width = Form1.Width
Image1.Height = Form1.Height
For i = 0 To 120
Label1(i).Width = Form1.Width / 11
Label1(i).Height = (Form1.Height / 11) * 0 .95
Next i
h = 0
For j = 0 To 110 Step 11
Label1(j).Left = 0
Label1(j).Top = Label1( 0 ).Height * h
For i = j + 1 To j + 10
Label1(i).Top = Label1(i - 1).Top
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Next i
h = h + 1
Next j
For i = 0 To 120
Label1(i).Visible = True
Next i
End Sub
Private Sub instrucciones_Click()
Label3.Visible = True
Timer2.Enabled = True
End Sub
Private Sub Label1_Mousemove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Rem establesco las zonas de cada clima
Label2.Caption = Index
If Label2.Caption >= 25 And Label2.Caption <= 32 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 2 And Label2.Caption <= 10 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 13 And Label2.Caption <= 21 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 37 And Label2.Caption <= 43 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 50 And Label2.Caption <= 52 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 22 And Label2.Caption <= 24 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 36 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 61 And Label2.Caption <= 63 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 53 And Label2.Caption <= 54 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 49 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 22 Then
frioocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
polar.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 33 And Label2.Caption <= 35 Then
frioocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
polar.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 44 And Label2.Caption <= 47 Then
frioocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
polar.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 68 And Label2.Caption <= 69 Then
subcs.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
polar.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 79 And Label2.Caption <= 80 Then
subcs.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
polar.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 57 And Label2.Caption <= 58 Then
tempocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
polar.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 59 And Label2.Caption <= 60 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 70 And Label2.Caption <= 71 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 81 And Label2.Caption <= 82 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 48 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 84 Then
tempconti.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
polar.Visible = False
End If
If Label2.Caption >= 72 And Label2.Caption <= 73 Then
tempconti.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
polar.Visible = False
End If
If Label2.Caption = 103 And 83 Then
desertico.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
polar.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 91 And Label2.Caption <= 93 Then
desertico.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
polar.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 74 And Label2.Caption <= 75 Then
temptransi.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
polar.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 64 Then
desertico.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
polar.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 94 And Label2.Caption <= 96 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 104 And Label2.Caption <= 105 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 115 And Label2.Caption <= 118 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 85 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
End Sub
Private Sub Timer1_Timer()
Rem el timer hace que a los diez segundos cualquier label que esta visible se haga invisible.
polar.Visible = False
continental.Visible = False
altura.Visible = False
subss.Visible = False
subcs.Visible = False
frioocea.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
temptransi.Visible = False
End Sub
Private Sub Timer2_Timer()
Label3.Visible = False
End Sub
Espero que les haya servido algun código por lo menos, y perdon primero que todo por como lo hice y presente no tengo experiencia ni nada! Jaja, y si lo expliqué mal perdonen, siempre está la primera vez, Saludos, cualquier pregunta estoy disponible!!!
Estos trabajos me los hicieron hacer para la escuela, hay de todo tipo.
Aca les dejo la explicación del Drag&Drop : ( Los Rem, son comentarios y va diciendo lo que sucedeo lo que es)
-Conceptos Básicos de Drag
Rem este Procedimiento se activa cuando movemos un objeto con el Mouse sobre el Formulario
Rem Se arrastra y suelta algún objeto cuya propiedad DragMode esta en 1
Rem Source es cualquier objeto que pueda ser arrastrado en este caso sobre el formulario, por ejemplo Source en este caso remplaza al Label1, Label2, etc
Rem X e Y representan la coordenada Horizontal y Vertical actual del puntero del Mouse
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Rem move ubica horizontalmente y verticalmente a un objeto
Rem es equivalente a utilizar el Left y luego el Top
Source.Move X, Y
End Sub
Private Sub Form_Load()
Label1.Caption = ""
Label1.BackColor = vbRed
Label1.DragMode = 1
Label2.Caption = ""
Label2.BackColor = vbBlue
Label2.DragMode = 1
End Sub
Un objeto (Image1) aparece en cualquier lugar al azar de un formulario maximizado, lo desplazamos hasta otro sitio cualquiera, y al soltar el botón izquierdo del Mouse, sale un mensaje que dice Volver al lugar de origen y al aceptar, el objeto arrastrado inmediatamente retorna a su posición original.
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Image1.Move X, Y
MsgBox "Volver al lugar de origen"
Image1.Move Label1.Left, Label1.Top
End Sub
Private Sub Form_Load()
Label1.Visible = False
Image1.DragMode = 1
Form1.WindowState = 2
End Sub
Private Sub Form_Resize()
Randomize
Image1.Move (Form1.Width - Image1.Width) * Rnd, (Form1.Height - Image1.Height) * Rnd
Rem utilizo Label1 como un objeto auxiliar para poder almacenar (recorder) en este caso la
Rem posicion que tenia la Imagen antes de ser movida
Label1.Left = Image1.Left
Label1.Top = Image1.Top
End Sub
-------------------------------------------------------------------------------
Trabajos
Les voy dejando el nombre que tienen y despues los objetos que se necesitan para que funcione y por último lo más importante: Los códigos .
Buscaminas con ceros
Un buscaminas como el juego de INICIO, pero con ceros...
Objetos requeridos:
- Label1 ( 23 matrices), es decir, 22 labels1 más, ya que el cero se cuenta como uno. Esto lo pueden hacer así : Copian el Label1, control + c , y luego ponen control + v , les aparecerá un cartel que dice algo asi como si desean crear una Matriz de controles, ponen aceptar, y pegan los labels restantes.
- Label2 ( UNO SOLO )
- Dos imágenes( Una con cara buena, y otra con mala, esto es para que cuando salga un " 0 " se ponga la cara mala, y luego apretandola se reinicia el juego con una buena). La cara mala debe ser la Image1 ( es decir la primer Image) , y la cara buena debe ser la Image2 ( es decir, la segunda Image).
Código :
Private Sub Form_Load()
Form1.WindowState = 2
Form1.Caption = "Evitando los ceros"
For i = 0 To 23
Label1(i).BackColor = vbWhite
Label1(i).Caption = ""
Label1(i).BorderStyle = 1
Label1(i).Appearance = 0
Label1(i).Font = "arial"
Label1(i).FontSize = 50
Label1(i).Alignment = 2
Label1(i).ForeColor = RGB( 0 , 186, 100)
Next i
Label2.Caption = 0
Label2.BorderStyle = 1
Label2.Appearance = 0
Label2.Font = "arial"
Label2.FontSize = 50
Label2.Alignment = 2
Image2.Visible = True
Image1.Visible = False
End Sub
Private Sub Form_Resize()
Image2.Left = Form1.Width / 2 - Image2.Width / 2
Image2.Top = Label1( 0 ).Top
Image1.Left = Form1.Width / 2 - Image2.Width / 2
Image1.Top = Label1( 0 ).Top
Label2.Width = Form1.Width / 10
Label2.Height = Form1.Height / 10
Label2.Top = 0
Label2.Left = 0
For i = 0 To 23
Label1(i).Width = Form1.Width / 10
Label1(i).Height = Form1.Height / 10
Next i
Label1( 0 ).Top = Form1.Height / 6 - Label1( 0 ).Height / 6
Label1( 0 ).Left = Form1.Width / 3 - Label1( 0 ).Width / 3
For i = 1 To 3
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1( 0 ).Top
Next i
Label1(4).Top = Label1( 0 ).Top + Label1(4).Height
Label1(4).Left = Label1( 0 ).Left
For i = 5 To 7
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(4).Top
Next i
Label1(8).Top = Label1(4).Top + Label1(8).Height
Label1(8).Left = Label1(4).Left
For i = 9 To 11
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(8).Top
Next i
Label1(12).Top = Label1(8).Top + Label1(12).Height
Label1(12).Left = Label1(8).Left
For i = 13 To 15
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(12).Top
Next i
Label1(16).Top = Label1(12).Top + Label1(16).Height
Label1(16).Left = Label1(12).Left
For i = 17 To 19
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(16).Top
Next i
Label1(20).Top = Label1(16).Top + Label1(20).Height
Label1(20).Left = Label1(16).Left
For i = 21 To 23
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Label1(i).Top = Label1(20).Top
Next i
End Sub
Private Sub Image1_Click()
Form_Load
End Sub
Private Sub Image2_Click()
Form_Load
End Sub
Private Sub Label1_Click(Index As Integer)
Randomize
For i = 0 To 23
Label1(Index).Caption = Int(9 * Rnd)
Next i
Label2.Caption = Val(Label2.Caption) + Val(Label1(Index))
If Label1(Index).Caption = 0 Then
For i = 0 To 23
Label1(i).Caption = Int(9 * Rnd)
Next i
Image2.Visible = False
Image1.Visible = True
End If
End Sub
------------------------------------------------------------------------------------------------------------------------------------------------------------
Trabajo de Nave y Misíl con Choque
Un trabajo original, JEJEJEJE de Naves ( en este trabajo se cumple algo muy importante la función de choques... entre objetos ) ( CON LAS FLECHITAS SE MUEVE, Y DISPARA CON SPACE)
Objetos Requeridos:
- Image1 ( Es la imagen de una nave, queda mejor una de fondo negro, pero funciona con cualquier imagen igual).
- Image2 ( UN MISÍL, que será el que impacte con la Image2 ( la nave).
- 5 timers, es decir : Timer1 , Timer2 , Timer3 , Timer4 , Timer5 .
Código :
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then
Image2.Left = Image2.Left + 100
End If
If KeyCode = vbKeyLeft Then
Image2.Left = Image2.Left - 100
End If
If KeyCode = vbKeySpace Then
Timer3.Enabled = True
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 30
Timer2.Enabled = False
Timer2.Interval = 30
Timer3.Enabled = False
Timer3.Interval = 10
Form1.BackColor = vbBlack
Form1.KeyPreview = True
Form1.WindowState = 2
Timer4.Enabled = True
Timer4.Interval = 30
Timer5.Enabled = False
Timer5.Interval = 30
End Sub
Private Sub Form_Resize()
Image2.Top = Form1.Height / 1 - Image2.Height / 1
Image2.Left = Form1.Width / 2 - Image2.Width / 2
End Sub
Private Sub Timer1_Timer()
Image1.Left = Image1.Left + 120
If Image1.Left >= Form1.Width - Image1.Width Then
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Image1.Left = Image1.Left - 135
If Image1.Left <= 0 Then
Timer2.Enabled = False
Timer1.Enabled = True
End If
End Sub
Private Sub Timer3_Timer()
Image2.Top = Image2.Top - 135
If Image2.Top <= 0 Then
Timer3.Enabled = False
Form_Resize
MsgBox "¡Le erraste a la nave!"
Timer3.Enabled = False
End If
If Image2.Left >= Image1.Left And Image2.Left <= Image1.Left + Image1.Width - Image2.Width And Image2.Top >= Image1.Top And Image2.Top <= Image1.Height + Image1.Top - Image2.Height Then
MsgBox "¡La Nave ha sido destruida!"
Timer3.Enabled = False
End If
If Image2.Left >= Image1.Left And Image2.Left <= Image1.Left + Image1.Width - Image2.Width And Image2.Top >= Image1.Top And Image2.Top <= Image1.Height + Image1.Top - Image2.Height Then
Image2.Top = Form1.Height / 1 - Image2.Height / 1
Image2.Left = Form1.Width / 2 - Image2.Width / 2
End If
End Sub
Private Sub Timer4_Timer()
Image2.Left = Image2.Left + 75
If Image2.Left >= Form1.Width - Image2.Width Then
Timer4.Enabled = False
Timer5.Enabled = True
End If
End Sub
Private Sub Timer5_Timer()
Image2.Left = Image2.Left - 75
If Image2.Left <= 0 Then
Timer5.Enabled = False
Timer4.Enabled = True
End If
End Sub
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Trabajo Didáctico(Geografía)
Aquí el mejor trabajo que hice... Y el más pesado, el que tiene más cosas, pero la verdad que vale mucho la pena.
Objetos Requeridos :
-Label1 ( Crear Matriz, copiar Label1 y hacer 120 labels1 ).
-Label2( uno solo está bien).
-Label3 ( Otra matriz pero esta vez crear solo 11 labels3, y ahora les digo que nombre le deben poner).
Va a haber un Label3 que va a quedar con ese (Nombre) , pero luego a otro Label3 que seguramente aparecera algo como así Label3( 0 o 1, o 2 ) el numero que sea, le ponen subss. Hago una lista mejor.
En la barra de propiedades un espacio se llamará o dirá ( Nombre ) : lo cambiarán por el que les diga.
A un Label3 lo dejan como está, es decir con el nombre de Label3
A otro le ponen subss en la barra de Propiedades ( Nombre).
A otro le ponen polar en la barra de Propiedades ( Nombre).
A otro le ponen frioocea en la barra de Propiedades ( Nombre).
A otro le ponen tempconti en la barra de Propiedades ( Nombre).
A otro le ponen continental en la barra de Propiedades ( Nombre).
A otro le ponen tempocea en la barra de Propiedades ( Nombre).
A otro le ponen temptransi en la barra de Propiedades ( Nombre).
A otro le ponen altura en la barra de Propiedades ( Nombre).
A otro le ponen subcs en la barra de Propiedades ( Nombre).
A otro le ponen desertico en la barra de Propiedades ( Nombre).
ESTOS SON LOS CLIMAS .
- Command1 ( esto es un objeto de comando )
- Timer1 y Timer2 ( Dos timers esta bien)
- Image1 ( La imagen de los climas de América del Norte en un mapa) Lo pueden copiar desde acá así tienen el que más va :
Copian esa Imágen, y en el Visual apretan en Image, y la imagen que copiaron la pegan en el espacio de la Image1.
Esa imagen en Propiedades le ponen Stretch True( quiere decir que se adapte cuando la moves de su tamaño)
Código :
Private Sub Form_Load()
Form1.Caption = " Climas de America del Norte"
Form1.WindowState = 2
For i = 0 To 120
Label1(i).Visible = True
Label1(i).Caption = ""
Label1(i).BorderStyle = 0
Label1(i).BackStyle = 0
Next i
Label3.Visible = False
Label3.ForeColor = vbRed
Label3.BackColor = vbBlack
Label3.BorderStyle = 1
Label3.FontSize = 32
Label3.Font = "arial"
Label3.Caption = "Pasá el mouse por las distintas partes de América del norte para enterarte de su clima y sus caracteristicas, muchas gracias."
Label2.Visible = False
Rem label 2 especifica en que label esta parado el mouse
Label2.ForeColor = vbRed
Label2.FontSize = 24
Rem polar es el label que representa el frio polar
polar.Visible = False
polar.ForeColor = vbWhite
polar.BackColor = RGB(120, 20, 150)
polar.BorderStyle = 1
polar.FontSize = 15
polar.Font = "arial"
polar.Caption = "El clima polar está caracterizado por tener casi permanentemente temperaturas por debajo de 0 ºC; y las precipitaciones son muy escasas. La humedad relativa en el aire es muy baja y el viento suele ser bastante intenso, lo que hace aún más hostiles las condiciones de vida en este clima.Las precipitaciones son escasas, inferiores a 250-300 mm al año, debido a la presencia permanente de anticiclones, y caen habitualmente en forma de nieve.Las aguas solo se encuentran en estado líquido en las zonas donde la temperatura sube de 0 ºC."
Rem continental es el label que representa el frio continental
continental.Visible = False
continental.BackColor = RGB( 0 , 110, 255)
continental.BorderStyle = 1
continental.FontSize = 15
continental.ForeColor = vbWhite
continental.Font = "arial"
continental.Caption = "Clima continental es conocido así al clima riguroso en donde las diferencias de temperaturas entre invierno y verano son enormes, así mismo con el día y la noche, los veranos son calientes y los inviernos muy fríos, siempre hay heladas en invierno (por alcanzar temperaturas bajo 0°C) y por lo general lluvias escasas, estas características se producen por localizarse en el interior de los continentes o por regiones aisladas por cadenas montañas que impide la influencia marítima."
Rem altura es el label que representa el frio de altura
altura.Visible = False
altura.BackColor = RGB(100, 210, 255)
altura.BorderStyle = 1
altura.FontSize = 13
altura.ForeColor = RGB( 0 , 0 , 100)
altura.Font = "arial"
altura.Caption = "El clima de montaña es más frío y húmedo que el del llano, puesto que la temperatura desciende a un ritmo aproximado de 5º cada 1 km de altitud y las lluvias van aumentado con la altura.Las montañas Rocosas reciben una cantidad moderada de precipitaciones en forma de lluvia, sobre todo durante los meses de invierno. Las praderas cubren los niveles inferiores y dan paso a grandes bosques de coníferas. Por encima de la zona arbolada se extienden pastizales y arbustos aislados. Las cimas de los picos tienen escasa vegetación y algunos están cubiertos de nieve y hielo durante todo el año."
Rem subss es el label que representa el clima de subtropical sin estacion seca
subss.Visible = False
subss.BackColor = RGB(170, 0 , 0 )
subss.BorderStyle = 1
subss.FontSize = 15
subss.ForeColor = vbWhite
subss.Font = "arial"
subss.Caption = "El clima subtropical sin estacion seca presenta lluvias abundantes y temperaturas del estilo del clima mediterráneo típico. Las precipitaciones oscilan entre los 500 y 1.200mm, siendo uno de sus principales aportes la denominada precipitación horizontal, dada por el mar de nubes o brumas, que son frecuentes en verano. La elevada humedad relativa es otra de las características, casi siempre superior al 70%. Las temperaturas no suelen bajar de los 12 °C en invierno ni superar los 30 °C en época estival. La vegetación más representativa y potencial de esta zona es el bosque húmedo o la laurisilva."
Rem frioocea representa el frio oceanico
frioocea.Visible = False
frioocea.BorderStyle = 1
frioocea.FontSize = 15
frioocea.ForeColor = vbWhite
frioocea.BackColor = RGB( 0 , 0 , 130)
frioocea.Font = "arial"
frioocea.Caption = "La temperatura de la estación más fría varia entre 0 y 5 grados y de la estación menos fría entre 8 y 10 grados.La humedad está dada por los vientos provenientes del anticiclón del Pacífico que descargan su humedad en el relieve.Las precipitaciones son abundantes, oscilan entre 1500 y 1800 milímetros anuales."
Rem tempocea representa el templado oceanico
tempocea.Visible = False
tempocea.BorderStyle = 1
tempocea.FontSize = 17
tempocea.ForeColor = RGB( 0 , 100, 0 )
tempocea.BackColor = RGB(190, 255, 150)
tempocea.Font = "arial"
tempocea.Caption = "Los Climas templados oceanicos se situan entre las latitudes de 45º y 55º. Están normalmente, al lado de los climas mediterráneos.Estos climas son dominantes a lo largo del año. Los veranos son frescos y nublados. Los inviernos son suaves, al contrario de otros climas , a una latitud semejante."
Rem subcs representa el clima subtropical con estacion seca
subcs.Visible = False
subcs.BorderStyle = 1
subcs.ForeColor = vbWhite
subcs.FontSize = 17
subcs.BackColor = vbRed
subcs.Caption = "Este clima se da entre los 25º y los 35º de latitud.En realidad no es otra cosa que una extensión hacia el norte del clima tropical seco, pero la precipitación es mayor y la amplitud térmica anual también. Está dominado por las masas de aire tropical continental, pero en las épocas en las que la posición relativa del sol es más baja pueden llegar masas de aire polar continental o marítimo."
subcs.Font = "arial"
Rem desertico representa el clima desertico
desertico.Visible = False
desertico.BorderStyle = 1
desertico.ForeColor = RGB(200, 100, 50)
desertico.FontSize = 14
desertico.BackColor = RGB(250, 200, 50)
desertico.Font = "arial"
desertico.Caption = "Clima desertico o arido.La temperatura media anual supera los 18ºC, y las temperaturas diarias presentan fuertes oscilaciones entre el día y la noche (20ºC o más).Las precipitaciones son muy escasas e irregulares, debido a la influencia permanente de anticiclones tropicales. En los bordes semiáridos del desierto, hay entre 750 y 150 mm anuales, y los meses áridos son más de siete.La vegetación del clima désertico es escasa, baja y dispersa. Deja extensas superficies sin cubrir, que están ocupadas por arena, piedras o rocas."
Rem tempconti representa el templado continental
tempconti.Visible = False
tempconti.BorderStyle = 1
tempconti.ForeColor = RGB( 0 , 100, 0 )
tempconti.FontSize = 16
tempconti.Font = "arial"
tempconti.BackColor = RGB(170, 255, 0 )
tempconti.Caption = "Este clima es propio de las regiones del interior de los continentes en latitudes superiores a 45º. Se caracteriza por una relativa escasez de lluvias, sobre todo en el inverno, debido a la distancia que las separa de las áreas de influencia marítima, y por una notable amplitud térmica estacional, con las temperaturas de verano bastante altas que contrastan fuertemente con los inviernos, muy frios. La temperatura media anual es inferior a 10 ºC."
Rem temptransi represant el templado de transicion
temptransi.Visible = False
temptransi.BorderStyle = 1
temptransi.ForeColor = vbWhite
temptransi.FontSize = 17
temptransi.BackColor = RGB( 0 , 100, 0 )
temptransi.Font = "arial"
temptransi.Caption = "Temperatura media anual 16ºC, en invierno, 9ºC y en verano, 22ºC. Las precipitaciones son cercanas a 700 mm., con veranos más lluviosos que los inviernos. Se ubican en zonas ubicadas entre las zonas oceánicas y continentales."
Timer1.Enabled = False
Timer1.Interval = 12000
Timer2.Enabled = False
Timer2.Interval = 6000
Rem instrucciones es el cartel de ayuda
instrucciones.Caption = "¡AYUDA!"
instrucciones.Appearance = 0
instrucciones.Font = "arial"
instrucciones.FontSize = 50
End Sub
Private Sub Form_Resize()
Rem ubico el label3( cartel de ayuda ) en el centro de la pantalla y le doy su tamaño
Label3.Height = Form1.Height / 2
Label3.Width = Form1.Width / 2
Label3.Top = Form1.Height / 2 - Label3.Height / 2
Label3.Left = Form1.Width / 2 - Label3.Width / 2
Rem ubico todos los labels y especifico su tamaño
polar.Width = Form1.Width / 4
polar.Height = Form1.Height / 1.7
polar.Top = Form1.Height / 1.8 - polar.Height / 2
polar.Left = 0
continental.Width = Form1.Width / 4
continental.Height = Form1.Height / 1.8
continental.Top = Form1.Height / 1. 6 - polar.Height / 2
continental.Left = 0
altura.Width = Form1.Width / 4
altura.Height = Form1.Height / 1.8
altura.Top = Form1.Height / 1. 6 - polar.Height / 2
altura.Left = 0
subcs.Width = Form1.Width / 4
subcs.Height = Form1.Height / 1. 6
subcs.Top = Form1.Height / 1.7 - polar.Height / 2
subcs.Left = 0
frioocea.Width = Form1.Width / 4
frioocea.Height = Form1.Height / 1.8
frioocea.Top = Form1.Height / 1.4 - polar.Height / 2
frioocea.Left = 0
subss.Width = Form1.Width / 4
subss.Height = Form1.Height / 1. 6
subss.Top = Form1.Height / 1.9 - polar.Height / 2
subss.Left = 0
temptransi.Width = Form1.Width / 4
temptransi.Height = Form1.Height / 1.8
temptransi.Top = Form1.Height / 1.4 - polar.Height / 2
temptransi.Left = 0
tempocea.Width = Form1.Width / 4
tempocea.Height = Form1.Height / 1.8
tempocea.Top = Form1.Height / 1.5 - polar.Height / 2
tempocea.Left = 0
tempconti.Width = Form1.Width / 4
tempconti.Height = Form1.Height / 1.8
tempconti.Top = Form1.Height / 1. 6 - polar.Height / 2
tempconti.Left = 0
desertico.Width = Form1.Width / 4
desertico.Height = Form1.Height / 1.7
desertico.Top = Form1.Height / 1.8 - polar.Height / 2
desertico.Left = 0
instrucciones.Left = 0
instrucciones.Top = Form1.Height / 1.16
Rem la matriz formada por 121 labels ayuda a formar zonas para indicar los climas
Image1.Top = 0
Image1.Left = 0
Image1.Width = Form1.Width
Image1.Height = Form1.Height
For i = 0 To 120
Label1(i).Width = Form1.Width / 11
Label1(i).Height = (Form1.Height / 11) * 0 .95
Next i
h = 0
For j = 0 To 110 Step 11
Label1(j).Left = 0
Label1(j).Top = Label1( 0 ).Height * h
For i = j + 1 To j + 10
Label1(i).Top = Label1(i - 1).Top
Label1(i).Left = Label1(i - 1).Left + Label1(i - 1).Width
Next i
h = h + 1
Next j
For i = 0 To 120
Label1(i).Visible = True
Next i
End Sub
Private Sub instrucciones_Click()
Label3.Visible = True
Timer2.Enabled = True
End Sub
Private Sub Label1_Mousemove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Rem establesco las zonas de cada clima
Label2.Caption = Index
If Label2.Caption >= 25 And Label2.Caption <= 32 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 2 And Label2.Caption <= 10 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 13 And Label2.Caption <= 21 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 37 And Label2.Caption <= 43 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 50 And Label2.Caption <= 52 Then
polar.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 22 And Label2.Caption <= 24 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 36 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 61 And Label2.Caption <= 63 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 53 And Label2.Caption <= 54 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 49 Then
continental.Visible = True
Timer1.Enabled = True
polar.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 22 Then
frioocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
polar.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 33 And Label2.Caption <= 35 Then
frioocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
polar.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 44 And Label2.Caption <= 47 Then
frioocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
polar.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 68 And Label2.Caption <= 69 Then
subcs.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
polar.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 79 And Label2.Caption <= 80 Then
subcs.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
polar.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 57 And Label2.Caption <= 58 Then
tempocea.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
polar.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 59 And Label2.Caption <= 60 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 70 And Label2.Caption <= 71 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 81 And Label2.Caption <= 82 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 48 Then
altura.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
polar.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 84 Then
tempconti.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
polar.Visible = False
End If
If Label2.Caption >= 72 And Label2.Caption <= 73 Then
tempconti.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
polar.Visible = False
End If
If Label2.Caption = 103 And 83 Then
desertico.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
polar.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 91 And Label2.Caption <= 93 Then
desertico.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
polar.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 74 And Label2.Caption <= 75 Then
temptransi.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
polar.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 64 Then
desertico.Visible = True
Timer1.Enabled = True
continental.Visible = False
subss.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
polar.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 94 And Label2.Caption <= 96 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 104 And Label2.Caption <= 105 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption >= 115 And Label2.Caption <= 118 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
If Label2.Caption = 85 Then
subss.Visible = True
Timer1.Enabled = True
continental.Visible = False
polar.Visible = False
subcs.Visible = False
altura.Visible = False
frioocea.Visible = False
temptransi.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
End If
End Sub
Private Sub Timer1_Timer()
Rem el timer hace que a los diez segundos cualquier label que esta visible se haga invisible.
polar.Visible = False
continental.Visible = False
altura.Visible = False
subss.Visible = False
subcs.Visible = False
frioocea.Visible = False
tempocea.Visible = False
desertico.Visible = False
tempconti.Visible = False
temptransi.Visible = False
End Sub
Private Sub Timer2_Timer()
Label3.Visible = False
End Sub
Espero que les haya servido algun código por lo menos, y perdon primero que todo por como lo hice y presente no tengo experiencia ni nada! Jaja, y si lo expliqué mal perdonen, siempre está la primera vez, Saludos, cualquier pregunta estoy disponible!!!