my code stock.com

Snippet options

Download: Download snippet as calculadora-paypal-ebay.vbs.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

Imports System.Math
Public Class Form1
    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        'Descarga de valores desde las paginas web
        If ComboBox1.Text = ("Peso Chileno") Then
            TextBox1.Text = WebBrowser1.Document.GetElementById("to_CLP").InnerHtml
            ComboBox1.Enabled = False
        End If
        If ComboBox1.Text = ("Peso Argentino") Then
            TextBox1.Text = WebBrowser1.Document.GetElementById("to_ARS").InnerHtml
            ComboBox1.Enabled = False
        End If
        If ComboBox1.Text = ("Sol Peruano") Then
            TextBox1.Text = WebBrowser1.Document.GetElementById("to_PEN").InnerHtml
            ComboBox1.Enabled = False
        End If
        If ComboBox1.Text = ("Peso Mexicano") Then
            TextBox1.Text = WebBrowser1.Document.GetElementById("to_MXN").InnerHtml
            ComboBox1.Enabled = False
        End If
        If ComboBox1.Text = ("Peso Colombiano") Then
            TextBox1.Text = WebBrowser1.Document.GetElementById("to_COP").InnerHtml
            ComboBox1.Enabled = False
        End If
        If ComboBox1.Text = ("Euro") Then
            TextBox1.Text = WebBrowser1.Document.GetElementById("to_EUR").InnerHtml
            ComboBox1.Enabled = False
        End If
    End Sub

    Private Sub Label4_Click(sender As Object, e As EventArgs) Handles Label4.Click

    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
        'Establecer webs
        If ComboBox1.Text = "" Then
            botoncito.Enabled = False
        End If
        If ComboBox1.Text = ("Peso Chileno") Then
            WebBrowser1.Navigate("http://www.valor-dolar.cl/")
            PictureBox1.Image = My.Resources.Chile
            botoncito.Enabled = True
            MsgBox("Ha seleccionado el Peso Chileno")
        End If
        If ComboBox1.Text = ("Peso Argentino") Then
            WebBrowser1.Navigate("http://www.valor-dolar.cl/dolar_peso_argentina")
            PictureBox1.Image = My.Resources.Argentina
            botoncito.Enabled = True
            MsgBox("Ha selecciona el Peso Argentino")
        End If
        If ComboBox1.Text = ("Sol Peruano") Then
            WebBrowser1.Navigate("http://www.precio-dolar.pe/")
            PictureBox1.Image = My.Resources.Peru
            botoncito.Enabled = True
            MsgBox("Ha seleccionado el Sol Peruano")
        End If
        If ComboBox1.Text = ("Peso Mexicano") Then
            WebBrowser1.Navigate("http://www.cambiodolar.mx/")
            PictureBox1.Image = My.Resources.Mexico
            botoncito.Enabled = True
            MsgBox("Ha seleccionado el Peso Mexicano")
        End If
        If ComboBox1.Text = ("Peso Colombiano") Then
            WebBrowser1.Navigate("http://preciodolar.co/")
            PictureBox1.Image = My.Resources.Colombia
            botoncito.Enabled = True
            MsgBox("Ha seleccionado el Peso Colombiano")
        End If
        If ComboBox1.Text = ("Euro") Then
            WebBrowser1.Navigate("http://www.cambio-euro.es/")
            PictureBox1.Image = My.Resources.UE
            botoncito.Enabled = True
            MsgBox("Ha seleccionado Euro")
        End If
    End Sub

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
        'Configuraciones graficas
        If CheckBox1.Checked = True Then
            PictureBox2.Image = My.Resources.Paypal
            TextBox4.Show()
            TextBox5.Show()
            TextBox6.Show()
            Label8.Show()
            Label9.Show()
            Label11.Show()
        End If
        If CheckBox1.Checked = False Then
            PictureBox2.Image = My.Resources.Image1
            TextBox4.Hide()
            TextBox5.Hide()
            TextBox6.Hide()
            Label8.Hide()
            Label9.Hide()
            Label11.Hide()
        End If
    End Sub

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

    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If ComboBox1.Text = "" Then
            botoncito.Enabled = False
        End If
    End Sub
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        WebBrowser2.Navigate(TextBox7.Text)
    End Sub

    Private Sub TextBox8_TextChanged(sender As Object, e As EventArgs) Handles TextBox8.TextChanged

    End Sub

    Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.Checked = True Then
            PictureBox3.Image = My.Resources.ebay
            TextBox2.ReadOnly = True
            Label12.Visible = True
            TextBox7.Visible = True
            Button3.Visible = True
            Label13.Visible = True
            Label14.Visible = True
            TextBox8.Visible = True
            TextBox10.Visible = True

        End If
        If CheckBox2.Checked = False Then
            PictureBox3.Image = My.Resources.Image1
            TextBox2.ReadOnly = False
            Label12.Visible = False
            TextBox7.Visible = False
            Button3.Visible = False
            Label13.Visible = False
            Label14.Visible = False
            TextBox8.Visible = False
            TextBox10.Visible = False
        End If
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles botoncito.Click
        If CheckBox1.Checked = True And CheckBox2.Checked = False Then
            Dim total As Double
            'declaro que la variable "total" va a ser una double
            total = TextBox1.Text * TextBox2.Text
            'declaro que "total" es una multiplicacion de esas 2 textbox
            TextBox3.Text = Round(total, 2)
            'la funcion "round" nos sirve para aproxima "Round(<Lo que queremos aproximar>, <Nº decimales>
            Dim total2 As Double
            total2 = (((TextBox2.Text * 0.054) + TextBox2.Text + 0.3) * TextBox1.Text)
            TextBox6.Text = Round(total2, 2)
        End If

        If CheckBox1.Checked = False And CheckBox2.Checked = False Then
            Dim total As Double
            total = TextBox1.Text * TextBox2.Text
            TextBox3.Text = Round(total, 2)
        End If

        If CheckBox1.Checked = False And CheckBox2.Checked = True Then
            Dim GranTotal As Double
            GranTotal = (TextBox1.Text * TextBox2.Text) + (TextBox8.Text * TextBox1.Text)
            TextBox3.Text = Round(GranTotal, 2)
        End If

        If CheckBox1.Checked = True And CheckBox2.Checked = True Then
            Dim Pay As Double
            Pay = (TextBox1.Text * TextBox2.Text) + (TextBox8.Text * TextBox1.Text)
            Dim Pay2 As Double
            Pay2 = ((((TextBox2.Text + 0.3 + TextBox8.Text) * 0.054) + (TextBox2.Text + 0.3 + TextBox8.Text)) * TextBox1.Text)
            TextBox6.Text = Round(Pay2, 2)
            Dim total As Double
            total = TextBox1.Text * TextBox2.Text
            TextBox3.Text = Round(total, 2)
        End If
    End Sub

    Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
        ComboBox1.Enabled = True
    End Sub

    Private Sub WebBrowser2_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser2.DocumentCompleted
        If TextBox7.Text.Contains("ebay") Then
            TextBox2.ReadOnly = True
            TextBox2.Text = WebBrowser2.Document.GetElementById("prcIsum").InnerHtml 'Descarga de precio
            TextBox2.Text = Mid(TextBox2.Text, 5).Replace(".", ",") 'Redendeo del precio
            TextBox11.Text = WebBrowser2.Document.GetElementById("prcIsum").InnerHtml
            TextBox11.Text = Mid(TextBox11.Text, 5).Replace(".", ",")
            TextBox8.Text = WebBrowser2.Document.GetElementById("fshippingCost").InnerText
            TextBox9.Text = WebBrowser2.Document.GetElementById("fshippingCost").InnerText
            If TextBox9.Text = ("GRATIS ") Then
                TextBox8.Text = ("0")
                TextBox10.Text = TextBox8.Text * TextBox1.Text
            End If

            Timer1.Enabled = False
            If TextBox9.Text = ("FREE   ") Then
                TextBox8.Text = ("0")
                TextBox10.Text = TextBox8.Text * TextBox1.Text
            End If

            Timer1.Enabled = False
            If TextBox9.Text.Contains("US") Then
                TextBox8.Text = Mid(TextBox8.Text, 4, 5).Replace(".", ",")
                'la función mid nos sirve para "recortar" un texto
                '(<lo que queremos recortar>,<caracter de inicio>,<caracter de termino>
                'la funcion replace es para reemplazar caracteres
                Dim envio As Double
                envio = TextBox8.Text * TextBox1.Text
                TextBox10.Text = Round(envio, 2)
            End If
        End If
    End Sub

    Private Sub TextBox7_TextChanged(sender As Object, e As EventArgs) Handles TextBox7.TextChanged
        If TextBox7.Text.Contains("ebay") Then Button3.Enabled = True
    End Sub

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

    End Sub
End Class

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.