Sunteți pe pagina 1din 20

Public Class Form1

Public USD(83) As String


Public BRL(83) As String
Public moeda As String = "USD"
Dim arquivo As String

Public minimiza As Boolean

Dim sound As New Media.SoundPlayer(My.Resources.Botao)

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

CoInternetSetFeatureEnabled(FEATURE_DISABLE_NAVIGATION_SOUNDS,
SET_FEATURE_ON_PROCESS, True)

form2.web.Navigate(New Uri("https://blockchain.info/pt/ticker"))

Panel2.Location = New Point(0, 0)


Panel3.Location = New Point(5, 0)
Panel4.Location = New Point(10, 0)
Panel5.Location = New Point(5, 0)
Panel6.Location = New Point(15, 0)
Panel7.Location = New Point(20, 0)
Panel8.Location = New Point(25, 0)
Panel9.Location = New Point(30, 0)
Panel10.Location = New Point(35, 0)
Panel11.Location = New Point(40, 0)
Panel12.Location = New Point(45, 0)
Panel13.Location = New Point(50, 0)
Panel14.Location = New Point(55, 0)
Panel15.Location = New Point(60, 0)
Panel16.Location = New Point(65, 0)
Panel17.Location = New Point(70, 0)
Panel18.Location = New Point(75, 0)
Panel19.Location = New Point(80, 0)
Panel20.Location = New Point(85, 0)
Panel21.Location = New Point(90, 0)
Panel22.Location = New Point(95, 0)
Panel23.Location = New Point(100, 0)
Panel24.Location = New Point(105, 0)
Panel25.Location = New Point(110, 0)
Panel26.Location = New Point(115, 0)
Panel27.Location = New Point(120, 0)
Panel28.Location = New Point(125, 0)
Panel29.Location = New Point(130, 0)
Panel30.Location = New Point(135, 0)
Panel31.Location = New Point(140, 0)
Panel32.Location = New Point(145, 0)
Panel33.Location = New Point(150, 0)
Panel34.Location = New Point(155, 0)
Panel35.Location = New Point(160, 0)
Panel36.Location = New Point(165, 0)
Panel37.Location = New Point(170, 0)
Panel38.Location = New Point(175, 0)
Panel39.Location = New Point(180, 0)
Panel40.Location = New Point(185, 0)
Panel41.Location = New Point(190, 0)
Panel42.Location = New Point(195, 0)
Panel43.Location = New Point(200, 0)
Panel44.Location = New Point(205, 0)
Panel45.Location = New Point(210, 0)
Panel46.Location = New Point(215, 0)
Panel47.Location = New Point(220, 0)
Panel48.Location = New Point(225, 0)
Panel49.Location = New Point(230, 0)
Panel50.Location = New Point(235, 0)
Panel51.Location = New Point(240, 0)
Panel52.Location = New Point(245, 0)
Panel53.Location = New Point(250, 0)
Panel54.Location = New Point(255, 0)
Panel55.Location = New Point(260, 0)
Panel56.Location = New Point(265, 0)
Panel57.Location = New Point(270, 0)
Panel58.Location = New Point(275, 0)
Panel59.Location = New Point(280, 0)
Panel60.Location = New Point(285, 0)
Panel61.Location = New Point(290, 0)
Panel62.Location = New Point(295, 0)
Panel63.Location = New Point(300, 0)
Panel64.Location = New Point(305, 0)
Panel65.Location = New Point(310, 0)
Panel66.Location = New Point(315, 0)
Panel67.Location = New Point(320, 0)
Panel68.Location = New Point(325, 0)
Panel69.Location = New Point(330, 0)
Panel70.Location = New Point(335, 0)
Panel71.Location = New Point(340, 0)
Panel72.Location = New Point(345, 0)
Panel73.Location = New Point(350, 0)
Panel74.Location = New Point(355, 0)
Panel75.Location = New Point(360, 0)
Panel76.Location = New Point(365, 0)
Panel77.Location = New Point(370, 0)
Panel78.Location = New Point(375, 0)
Panel79.Location = New Point(380, 0)
Panel80.Location = New Point(385, 0)
Panel81.Location = New Point(390, 0)
Panel82.Location = New Point(395, 0)
Panel83.Location = New Point(400, 0)

Panel2.Height = 300
Panel3.Height = 300
Panel4.Height = 300
Panel5.Height = 300
Panel6.Height = 300
Panel7.Height = 300
Panel8.Height = 300
Panel9.Height = 300
Panel10.Height = 300
Panel11.Height = 300
Panel12.Height = 300
Panel13.Height = 300
Panel14.Height = 300
Panel15.Height = 300
Panel16.Height = 300
Panel17.Height = 300
Panel18.Height = 300
Panel19.Height = 300
Panel20.Height = 300
Panel21.Height = 300
Panel22.Height = 300
Panel23.Height = 300
Panel24.Height = 300
Panel25.Height = 300
Panel26.Height = 300
Panel27.Height = 300
Panel28.Height = 300
Panel29.Height = 300
Panel30.Height = 300
Panel31.Height = 300
Panel32.Height = 300
Panel33.Height = 300
Panel34.Height = 300
Panel35.Height = 300
Panel36.Height = 300
Panel37.Height = 300
Panel38.Height = 300
Panel39.Height = 300
Panel40.Height = 300
Panel41.Height = 300
Panel42.Height = 300
Panel43.Height = 300
Panel44.Height = 300
Panel45.Height = 300
Panel46.Height = 300
Panel47.Height = 300
Panel48.Height = 300
Panel49.Height = 300
Panel50.Height = 300
Panel51.Height = 300
Panel52.Height = 300
Panel53.Height = 300
Panel54.Height = 300
Panel55.Height = 300
Panel56.Height = 300
Panel57.Height = 300
Panel58.Height = 300
Panel59.Height = 300
Panel60.Height = 300
Panel61.Height = 300
Panel62.Height = 300
Panel63.Height = 300
Panel64.Height = 300
Panel65.Height = 300
Panel66.Height = 300
Panel67.Height = 300
Panel68.Height = 300
Panel69.Height = 300
Panel70.Height = 300
Panel71.Height = 300
Panel72.Height = 300
Panel73.Height = 300
Panel74.Height = 300
Panel75.Height = 300
Panel76.Height = 300
Panel77.Height = 300
Panel78.Height = 300
Panel79.Height = 300
Panel80.Height = 300
Panel81.Height = 300
Panel82.Height = 300
Panel83.Height = 300

End Sub

Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As


WebBrowserDocumentCompletedEventArgs)

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


Button1.Click

Timer1.Start()

End Sub

Public Sub AtualizaDados()

form2.web.Refresh(WebBrowserRefreshOption.Completely)

ep:
While Form2.Web.ReadyState = WebBrowserReadyState.Loading Or
Form2.Web.ReadyState = WebBrowserReadyState.Uninitialized

Application.DoEvents()

End While

While Not Form2.Web.ReadyState = WebBrowserReadyState.Complete

GoTo ep

End While

Dim a() As String = Split(Form2.Web.Document.Body.InnerText, "}")


Dim ap As String = ", " & """" & "sell"

Movimenta()

Try

Dim b() As String = Split(a(0), ap)


Dim c() As String = Split(b(0), ": ")

USD(83) = c(c.Length - 1).Replace(".", ",")


Catch ex As Exception

End Try

AtualizaGraficoUSD()

Try

Dim b() As String = Split(a(19), ap)


Dim c() As String = Split(b(0), ": ")

BRL(83) = c(c.Length - 1).Replace(".", ",")

Catch ex As Exception

End Try

AtualizaGraficoBRL()

' c(c.Length - 1)

End Sub

Public Sub Movimenta()

For i = 0 To 82

USD(i) = USD(i + 1)
BRL(i) = BRL(i + 1)

Next

End Sub

Public Sub AtualizaGraficoUSD()

On Error Resume Next

If moeda = "USD" Then

Dim n As Integer = 2

Panel2.Height = 300 - (USD(n) / 2)


n += 1
Panel3.Height = 300 - (USD(n) / 2)
n += 1
Panel4.Height = 300 - (USD(n) / 2)
n += 1
Panel5.Height = 300 - (USD(n) / 2)
n += 1
Panel6.Height = 300 - (USD(n) / 2)
n += 1
Panel7.Height = 300 - (USD(n) / 2)
n += 1
Panel8.Height = 300 - (USD(n) / 2)
n += 1
Panel9.Height = 300 - (USD(n) / 2)
n += 1
Panel10.Height = 300 - (USD(n) / 2)
n += 1
Panel11.Height = 300 - (USD(n) / 2)
n += 1
Panel12.Height = 300 - (USD(n) / 2)
n += 1
Panel13.Height = 300 - (USD(n) / 2)
n += 1
Panel14.Height = 300 - (USD(n) / 2)
n += 1
Panel15.Height = 300 - (USD(n) / 2)
n += 1
Panel16.Height = 300 - (USD(n) / 2)
n += 1
Panel17.Height = 300 - (USD(n) / 2)
n += 1
Panel18.Height = 300 - (USD(n) / 2)
n += 1
Panel19.Height = 300 - (USD(n) / 2)
n += 1
Panel20.Height = 300 - (USD(n) / 2)
n += 1
Panel21.Height = 300 - (USD(n) / 2)
n += 1
Panel22.Height = 300 - (USD(n) / 2)
n += 1
Panel23.Height = 300 - (USD(n) / 2)
n += 1
Panel24.Height = 300 - (USD(n) / 2)
n += 1
Panel25.Height = 300 - (USD(n) / 2)
n += 1
Panel26.Height = 300 - (USD(n) / 2)
n += 1
Panel27.Height = 300 - (USD(n) / 2)
n += 1
Panel28.Height = 300 - (USD(n) / 2)
n += 1
Panel29.Height = 300 - (USD(n) / 2)
n += 1
Panel30.Height = 300 - (USD(n) / 2)
n += 1
Panel31.Height = 300 - (USD(n) / 2)
n += 1
Panel32.Height = 300 - (USD(n) / 2)
n += 1
Panel33.Height = 300 - (USD(n) / 2)
n += 1
Panel34.Height = 300 - (USD(n) / 2)
n += 1
Panel35.Height = 300 - (USD(n) / 2)
n += 1
Panel36.Height = 300 - (USD(n) / 2)
n += 1
Panel37.Height = 300 - (USD(n) / 2)
n += 1
Panel38.Height = 300 - (USD(n) / 2)
n += 1
Panel39.Height = 300 - (USD(n) / 2)
n += 1
Panel40.Height = 300 - (USD(n) / 2)
n += 1
Panel41.Height = 300 - (USD(n) / 2)
n += 1
Panel42.Height = 300 - (USD(n) / 2)
n += 1
Panel43.Height = 300 - (USD(n) / 2)
n += 1
Panel44.Height = 300 - (USD(n) / 2)
n += 1
Panel45.Height = 300 - (USD(n) / 2)
n += 1
Panel46.Height = 300 - (USD(n) / 2)
n += 1
Panel47.Height = 300 - (USD(n) / 2)
n += 1
Panel48.Height = 300 - (USD(n) / 2)
n += 1
Panel49.Height = 300 - (USD(n) / 2)
n += 1
Panel50.Height = 300 - (USD(n) / 2)
n += 1
Panel51.Height = 300 - (USD(n) / 2)
n += 1
Panel52.Height = 300 - (USD(n) / 2)
n += 1
Panel53.Height = 300 - (USD(n) / 2)
n += 1
Panel54.Height = 300 - (USD(n) / 2)
n += 1
Panel55.Height = 300 - (USD(n) / 2)
n += 1
Panel56.Height = 300 - (USD(n) / 2)
n += 1
Panel57.Height = 300 - (USD(n) / 2)
n += 1
Panel58.Height = 300 - (USD(n) / 2)
n += 1
Panel59.Height = 300 - (USD(n) / 2)
n += 1
Panel60.Height = 300 - (USD(n) / 2)
n += 1
Panel61.Height = 300 - (USD(n) / 2)
n += 1
Panel62.Height = 300 - (USD(n) / 2)
n += 1
Panel63.Height = 300 - (USD(n) / 2)
n += 1
Panel64.Height = 300 - (USD(n) / 2)
n += 1
Panel65.Height = 300 - (USD(n) / 2)
n += 1
Panel66.Height = 300 - (USD(n) / 2)
n += 1
Panel67.Height = 300 - (USD(n) / 2)
n += 1
Panel68.Height = 300 - (USD(n) / 2)
n += 1
Panel69.Height = 300 - (USD(n) / 2)
n += 1
Panel70.Height = 300 - (USD(n) / 2)
n += 1
Panel71.Height = 300 - (USD(n) / 2)
n += 1
Panel72.Height = 300 - (USD(n) / 2)
n += 1
Panel73.Height = 300 - (USD(n) / 2)
n += 1
Panel74.Height = 300 - (USD(n) / 2)
n += 1
Panel75.Height = 300 - (USD(n) / 2)
n += 1
Panel76.Height = 300 - (USD(n) / 2)
n += 1
Panel77.Height = 300 - (USD(n) / 2)
n += 1
Panel78.Height = 300 - (USD(n) / 2)
n += 1
Panel79.Height = 300 - (USD(n) / 2)
n += 1
Panel80.Height = 300 - (USD(n) / 2)
n += 1
Panel81.Height = 300 - (USD(n) / 2)
n += 1
Panel82.Height = 300 - (USD(n) / 2)
n += 1
Panel83.Height = 300 - (USD(n) / 2)

If CheckBox1.Checked Then

If USD(83) > TextBox1.Text Then

If RadioButton1.Checked Then

sound.Play()

ElseIf RadioButton2.Checked Then

Process.Start(arquivo)

End If

CheckBox1.Checked = False

End If

End If

If CheckBox2.Checked Then

If USD(83) < TextBox2.Text Then

If RadioButton1.Checked Then
sound.Play()

ElseIf RadioButton2.Checked Then

Process.Start(arquivo)

End If

CheckBox2.Checked = False

End If

End If

End If

Label9.Text = USD(83)

If Label9.Text > Label10.Text Then

Label10.Text = Label9.Text

End If

End Sub

Public Sub AtualizaGraficoBRL()

On Error Resume Next

If moeda = "BRL" Then

Dim n As Integer = 2

Panel2.Height = 300 - (BRL(n) / 10)


n += 1
Panel3.Height = 300 - (BRL(n) / 10)
n += 1
Panel4.Height = 300 - (BRL(n) / 10)
n += 1
Panel5.Height = 300 - (BRL(n) / 10)
n += 1
Panel6.Height = 300 - (BRL(n) / 10)
n += 1
Panel7.Height = 300 - (BRL(n) / 10)
n += 1
Panel8.Height = 300 - (BRL(n) / 10)
n += 1
Panel9.Height = 300 - (BRL(n) / 10)
n += 1
Panel10.Height = 300 - (BRL(n) / 10)
n += 1
Panel11.Height = 300 - (BRL(n) / 10)
n += 1
Panel12.Height = 300 - (BRL(n) / 10)
n += 1
Panel13.Height = 300 - (BRL(n) / 10)
n += 1
Panel14.Height = 300 - (BRL(n) / 10)
n += 1
Panel15.Height = 300 - (BRL(n) / 10)
n += 1
Panel16.Height = 300 - (BRL(n) / 10)
n += 1
Panel17.Height = 300 - (BRL(n) / 10)
n += 1
Panel18.Height = 300 - (BRL(n) / 10)
n += 1
Panel19.Height = 300 - (BRL(n) / 10)
n += 1
Panel20.Height = 300 - (BRL(n) / 10)
n += 1
Panel21.Height = 300 - (BRL(n) / 10)
n += 1
Panel22.Height = 300 - (BRL(n) / 10)
n += 1
Panel23.Height = 300 - (BRL(n) / 10)
n += 1
Panel24.Height = 300 - (BRL(n) / 10)
n += 1
Panel25.Height = 300 - (BRL(n) / 10)
n += 1
Panel26.Height = 300 - (BRL(n) / 10)
n += 1
Panel27.Height = 300 - (BRL(n) / 10)
n += 1
Panel28.Height = 300 - (BRL(n) / 10)
n += 1
Panel29.Height = 300 - (BRL(n) / 10)
n += 1
Panel30.Height = 300 - (BRL(n) / 10)
n += 1
Panel31.Height = 300 - (BRL(n) / 10)
n += 1
Panel32.Height = 300 - (BRL(n) / 10)
n += 1
Panel33.Height = 300 - (BRL(n) / 10)
n += 1
Panel34.Height = 300 - (BRL(n) / 10)
n += 1
Panel35.Height = 300 - (BRL(n) / 10)
n += 1
Panel36.Height = 300 - (BRL(n) / 10)
n += 1
Panel37.Height = 300 - (BRL(n) / 10)
n += 1
Panel38.Height = 300 - (BRL(n) / 10)
n += 1
Panel39.Height = 300 - (BRL(n) / 10)
n += 1
Panel40.Height = 300 - (BRL(n) / 10)
n += 1
Panel41.Height = 300 - (BRL(n) / 10)
n += 1
Panel42.Height = 300 - (BRL(n) / 10)
n += 1
Panel43.Height = 300 - (BRL(n) / 10)
n += 1
Panel44.Height = 300 - (BRL(n) / 10)
n += 1
Panel45.Height = 300 - (BRL(n) / 10)
n += 1
Panel46.Height = 300 - (BRL(n) / 10)
n += 1
Panel47.Height = 300 - (BRL(n) / 10)
n += 1
Panel48.Height = 300 - (BRL(n) / 10)
n += 1
Panel49.Height = 300 - (BRL(n) / 10)
n += 1
Panel50.Height = 300 - (BRL(n) / 10)
n += 1
Panel51.Height = 300 - (BRL(n) / 10)
n += 1
Panel52.Height = 300 - (BRL(n) / 10)
n += 1
Panel53.Height = 300 - (BRL(n) / 10)
n += 1
Panel54.Height = 300 - (BRL(n) / 10)
n += 1
Panel55.Height = 300 - (BRL(n) / 10)
n += 1
Panel56.Height = 300 - (BRL(n) / 10)
n += 1
Panel57.Height = 300 - (BRL(n) / 10)
n += 1
Panel58.Height = 300 - (BRL(n) / 10)
n += 1
Panel59.Height = 300 - (BRL(n) / 10)
n += 1
Panel60.Height = 300 - (BRL(n) / 10)
n += 1
Panel61.Height = 300 - (BRL(n) / 10)
n += 1
Panel62.Height = 300 - (BRL(n) / 10)
n += 1
Panel63.Height = 300 - (BRL(n) / 10)
n += 1
Panel64.Height = 300 - (BRL(n) / 10)
n += 1
Panel65.Height = 300 - (BRL(n) / 10)
n += 1
Panel66.Height = 300 - (BRL(n) / 10)
n += 1
Panel67.Height = 300 - (BRL(n) / 10)
n += 1
Panel68.Height = 300 - (BRL(n) / 10)
n += 1
Panel69.Height = 300 - (BRL(n) / 10)
n += 1
Panel70.Height = 300 - (BRL(n) / 10)
n += 1
Panel71.Height = 300 - (BRL(n) / 10)
n += 1
Panel72.Height = 300 - (BRL(n) / 10)
n += 1
Panel73.Height = 300 - (BRL(n) / 10)
n += 1
Panel74.Height = 300 - (BRL(n) / 10)
n += 1
Panel75.Height = 300 - (BRL(n) / 10)
n += 1
Panel76.Height = 300 - (BRL(n) / 10)
n += 1
Panel77.Height = 300 - (BRL(n) / 10)
n += 1
Panel78.Height = 300 - (BRL(n) / 10)
n += 1
Panel79.Height = 300 - (BRL(n) / 10)
n += 1
Panel80.Height = 300 - (BRL(n) / 10)
n += 1
Panel81.Height = 300 - (BRL(n) / 10)
n += 1
Panel82.Height = 300 - (BRL(n) / 10)
n += 1
Panel83.Height = 300 - (BRL(n) / 10)

If CheckBox1.Checked Then

If BRL(83) > TextBox1.Text Then

If RadioButton1.Checked Then

sound.Play()

ElseIf RadioButton2.Checked Then

Process.Start(arquivo)

End If

CheckBox1.Checked = False

End If

End If

If CheckBox2.Checked Then

If BRL(83) < TextBox2.Text Then

If RadioButton1.Checked Then

sound.Play()

ElseIf RadioButton2.Checked Then


Process.Start(arquivo)

End If

CheckBox2.Checked = False

End If

End If

End If

Label14.Text = BRL(83)

If Label14.Text > Label13.Text Then

Label13.Text = Label14.Text

End If

End Sub

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

If ComboBox1.Text = "Tempo real" Then


Real.Start()
ElseIf ComboBox1.Text = "1 minuto" Then
Minuto1.Start()
ElseIf ComboBox1.Text = "5 minutos" Then
Minuto5.Start()
ElseIf ComboBox1.Text = "10 minutos" Then
Minuto10.Start()
ElseIf ComboBox1.Text = "15 minutos" Then
Minuto15.Start()
ElseIf ComboBox1.Text = "20 minutos" Then
Minuto20.Start()
ElseIf ComboBox1.Text = "25 minutos" Then
Minuto25.Start()
ElseIf ComboBox1.Text = "30 minutos" Then
Minuto30.Start()
ElseIf ComboBox1.Text = "45 minutos" Then
Minuto45.Start()
ElseIf ComboBox1.Text = "60 minutos" Then
Hora.Start()

End If

End Sub

Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles


CheckBox1.CheckedChanged

If TextBox1.Text = "" Then

CheckBox1.Checked = False

End If
If CheckBox1.Checked Then

TextBox1.Enabled = False

Else

TextBox1.Enabled = True

End If

End Sub

Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles


CheckBox2.CheckedChanged

If TextBox2.Text = "" Then

CheckBox2.Checked = False

End If

If CheckBox2.Checked Then

TextBox2.Enabled = False

Else

TextBox2.Enabled = True

End If

End Sub

Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs)


Handles RadioButton2.CheckedChanged

If RadioButton2.Checked Then

Dim a As New OpenFileDialog

If a.ShowDialog = Windows.Forms.DialogResult.OK Then

If My.Computer.FileSystem.FileExists(a.FileName) Then

arquivo = a.FileName

Else

MsgBox("Arquivo não existe")

End If

Else

RadioButton1.Checked = True
End If

End If

End Sub

Private Sub Minuto1_Tick(sender As Object, e As EventArgs) Handles Minuto1.Tick

Minuto1.Stop()
AtualizaDados()
End Sub

Private Sub Minuto5_Tick(sender As Object, e As EventArgs) Handles Minuto5.Tick


Minuto5.Stop()
AtualizaDados()
End Sub

Private Sub Minuto10_Tick(sender As Object, e As EventArgs) Handles


Minuto10.Tick
Minuto10.Stop()
AtualizaDados()
End Sub

Private Sub Minuto15_Tick(sender As Object, e As EventArgs) Handles


Minuto15.Tick
Minuto15.Stop()
AtualizaDados()
End Sub

Private Sub Minuto20_Tick(sender As Object, e As EventArgs) Handles


Minuto20.Tick
Minuto20.Stop()
AtualizaDados()
End Sub

Private Sub Minuto25_Tick(sender As Object, e As EventArgs) Handles


Minuto25.Tick
Minuto25.Stop()
AtualizaDados()
End Sub

Private Sub Minuto30_Tick(sender As Object, e As EventArgs) Handles


Minuto30.Tick
Minuto30.Stop()
AtualizaDados()
End Sub

Private Sub Minuto45_Tick(sender As Object, e As EventArgs) Handles


Minuto45.Tick
Minuto45.Stop()
AtualizaDados()
End Sub

Private Sub Hora_Tick(sender As Object, e As EventArgs) Handles Hora.Tick


Hora.Stop()
AtualizaDados()
End Sub

Private Sub Real_Tick(sender As Object, e As EventArgs) Handles Real.Tick


Real.Stop()
AtualizaDados()
End Sub

Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs)


Handles ComboBox2.SelectedIndexChanged

If ComboBox2.Text = "USD" Then


moeda = "USD"
Label1.Text = "600"
Label5.Text = "500"
Label3.Text = "400"
Label2.Text = "300"
Label6.Text = "200"
Label7.Text = "100"

Else
moeda = "BRL"
Label1.Text = "3000"
Label5.Text = "2500"
Label3.Text = "2000"
Label2.Text = "1500"
Label6.Text = "1000"
Label7.Text = "500"

End If

End Sub

Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


TextBox1.KeyPress
Dim KeyAscii As Short = CShort(Asc(e.KeyChar))

KeyAscii = CShort(SoNumeros(KeyAscii))

If KeyAscii = 0 Then

e.Handled = True

End If
End Sub

Private Sub TextBox2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


TextBox2.KeyPress
Dim KeyAscii As Short = CShort(Asc(e.KeyChar))

KeyAscii = CShort(SoNumeros(KeyAscii))

If KeyAscii = 0 Then

e.Handled = True

End If
End Sub

Private Sub Panel84_Click(sender As Object, e As EventArgs) Handles


Panel84.Click

Dim a As New ColorDialog


If a.ShowDialog = Windows.Forms.DialogResult.OK Then

Panel84.BackColor = a.Color
CorFundo(a.Color)

End If

End Sub

Public Sub CorFundo(b As Color)

Panel2.BackColor = b
Panel3.BackColor = b
Panel4.BackColor = b
Panel5.BackColor = b
Panel6.BackColor = b
Panel7.BackColor = b
Panel8.BackColor = b
Panel9.BackColor = b
Panel10.BackColor = b
Panel11.BackColor = b
Panel12.BackColor = b
Panel13.BackColor = b
Panel14.BackColor = b
Panel15.BackColor = b
Panel16.BackColor = b
Panel17.BackColor = b
Panel18.BackColor = b
Panel19.BackColor = b
Panel20.BackColor = b
Panel21.BackColor = b
Panel22.BackColor = b
Panel23.BackColor = b
Panel24.BackColor = b
Panel25.BackColor = b
Panel26.BackColor = b
Panel27.BackColor = b
Panel28.BackColor = b
Panel29.BackColor = b
Panel30.BackColor = b
Panel31.BackColor = b
Panel32.BackColor = b
Panel33.BackColor = b
Panel34.BackColor = b
Panel35.BackColor = b
Panel36.BackColor = b
Panel37.BackColor = b
Panel38.BackColor = b
Panel39.BackColor = b
Panel40.BackColor = b
Panel41.BackColor = b
Panel42.BackColor = b
Panel43.BackColor = b
Panel44.BackColor = b
Panel45.BackColor = b
Panel46.BackColor = b
Panel47.BackColor = b
Panel48.BackColor = b
Panel49.BackColor = b
Panel50.BackColor = b
Panel51.BackColor = b
Panel52.BackColor = b
Panel53.BackColor = b
Panel54.BackColor = b
Panel55.BackColor = b
Panel56.BackColor = b
Panel57.BackColor = b
Panel58.BackColor = b
Panel59.BackColor = b
Panel60.BackColor = b
Panel61.BackColor = b
Panel62.BackColor = b
Panel63.BackColor = b
Panel64.BackColor = b
Panel65.BackColor = b
Panel66.BackColor = b
Panel67.BackColor = b
Panel68.BackColor = b
Panel69.BackColor = b
Panel70.BackColor = b
Panel71.BackColor = b
Panel72.BackColor = b
Panel73.BackColor = b
Panel74.BackColor = b
Panel75.BackColor = b
Panel76.BackColor = b
Panel77.BackColor = b
Panel78.BackColor = b
Panel79.BackColor = b
Panel80.BackColor = b
Panel81.BackColor = b
Panel82.BackColor = b
Panel83.BackColor = b

End Sub

Private Sub Panel85_Click(sender As Object, e As EventArgs) Handles


Panel85.Click

Dim a As New ColorDialog

If a.ShowDialog = Windows.Forms.DialogResult.OK Then

Panel85.BackColor = a.Color
Panel1.BackColor = a.Color

End If

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles


Button2.Click
Form3.ShowDialog()
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles


Button3.Click

Dim SalvarPNG As New SaveFileDialog

SalvarPNG.Filter = "Imagem|*.Jpeg"

If SalvarPNG.ShowDialog = Windows.Forms.DialogResult.OK Then

Try

SavePagina(SalvarPNG.FileName)

MsgBox("Salvo com sucesso", MsgBoxStyle.Information, "Salvo")

Catch ex As Exception

MsgBox("Erro, tente novamente", MsgBoxStyle.Critical, "Erro")

End Try

End If

End Sub

Private Sub SavePagina(ByVal filename As String)

Dim bmp As New Bitmap(Panel86.Width, Panel86.Height)


Panel86.DrawToBitmap(bmp, Panel86.DisplayRectangle)

Try

bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg)

Catch ex As Exception

MsgBox("Erro, " & ex.Message, MsgBoxStyle.OkOnly, "Erro")

End Try

End Sub

Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs)


Handles MyBase.FormClosing

Form4.ShowDialog()

If minimiza = True Then


NotifyIcon1.Visible = True
Me.Hide()
e.Cancel = True

Else

End If
End Sub

Private Sub NotifyIcon1_MouseDoubleClick(sender As Object, e As MouseEventArgs)


Handles NotifyIcon1.MouseDoubleClick
Me.Show()
NotifyIcon1.Visible = False

End Sub

End Class

S-ar putea să vă placă și