Jump to content

Recommended Posts

Posted

Boas, aqui fica a minha primeira contribuição nesta secção, algo muito simples.

O utilizador insere um valor, e depois esse valor e apresentado em milhas e em quilometros.

Public Class Form1

    Private Sub Btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn1.Click
        Dim dist As String
        Dim m As String
        Dim k As String

        dist = TxtD.Text
        If (dist <> "") Then

            m = dist / 1.6
            k = dist * 1.6

            TxtM.Text = m
            TxtK.Text = k

        Else
            TxtM.Text = "Por favor insere um valor!"
        End If
    End Sub

    Private Sub BtnSair_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSair.Click
        Me.Close()


    End Sub
End Class

Proud LEIC-A@IST student!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.