Public Class Form1

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If (TextBox1.Text <> "" And TextBox2.Text <> "") Then
            If Val(TextBox1.Text) <> 0 And Val(TextBox2.Text <> 0) Then
                TextBox3.Text = Math.Sqrt(Val(TextBox1.Text) ^ 2 + Val(TextBox2.Text) ^ 2)
            End If
        End If
    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        If (TextBox1.Text <> "" And TextBox2.Text <> "") Then
            If Val(TextBox1.Text) <> 0 And Val(TextBox2.Text <> 0) Then
                TextBox3.Text = Math.Sqrt(Val(TextBox1.Text) ^ 2 + Val(TextBox2.Text) ^ 2)
            End If
        End If
    End Sub
End Class
