You are on page 1of 2

CALDERA A PUNTO DE EXPLOTAR

Public Class Form1

Dim rojo, verde As Integer

Private Sub VScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles


VScrollBar1.Scroll

If VScrollBar1.Value >= 0 Then


verde = 255
rojo = 255 - VScrollBar1.Value
End If

If VScrollBar1.Value <= 0 Then


rojo = 255
verde = 255 + VScrollBar1.Value
End If

PictureBox1.BackColor = Color.FromArgb(rojo, verde, 0)


txtrojo.Text = rojo.ToString
txtverde.Text = verde.ToString

txttemperatura.Text = ((255 - VScrollBar1.Value) / 255) * 200

If VScrollBar1.Value <= -220 Then


MsgBox("VA A EXPLOTAR!!!", MsgBoxStyle.Critical, "TEMPERATURA EXTREMA")
End If

End Sub

Private Sub txtsetear_Click(sender As Object, e As EventArgs) Handles btnsetear.Click

VScrollBar1.Value = 255 - (Val(txtsetear.Text) * 255) / 200

If VScrollBar1.Value >= 0 Then


verde = 255
rojo = 255 - VScrollBar1.Value
End If

If VScrollBar1.Value <= 0 Then


rojo = 255
verde = 255 + VScrollBar1.Value
End If
PictureBox1.BackColor = Color.FromArgb(rojo, verde, 0)
End Sub

End Class

SCROLL CON IMAGEN

Public Class Form1


Dim x, y As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

PictureBox1.Left = 175
PictureBox1.Top = 175

End Sub

Private Sub HScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles


HScrollBar1.Scroll

PictureBox1.Left = 175 + HScrollBar1.Value

End Sub

Private Sub VScrollBar1_Scroll(sender As Object, e As ScrollEventArgs) Handles


VScrollBar1.Scroll

PictureBox1.Top = 175 + VScrollBar1.Value

End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

x = PictureBox1.Left
y = PictureBox1.Top

PictureBox1.Left = x + 1
PictureBox1.Top = y + 1

If PictureBox1.Left >= 250 Then

You might also like