
Código: Seleccionar todo
Option Explicit
Private Sub Command1_Click()
Dim valor, fahrenheit, celsius, rakion As Double
valor = Val(Text1.Text)
If Combo1.Text = "FAHRENHEIT" Then
Label4.Caption = "ES " & (valor - 32) / 1.8 & " GRADOS CELSIUS"
Label5.Caption = "ES " & (5 * (valor - 32) / 9) + 273.15 & " GRADOS KELVIN"
End If
If Combo1.Text = "CELSIUS" Then
Label4.Caption = "ES " & ((9 * valor) / 5) + 32 & " GRADOS FAHRENHEIT"
Label5.Caption = "ES " & valor + 273.15 & " GRADOS KELVIN"
End If
If Combo1.Text = "KELVIN" Then
Label4.Caption = "ES " & (9 * (valor - 273.15) / 5) + 32 & " GRADOS FAHRENHEIT"
Label5.Caption = "ES " & valor - 273.15 & " GRADOS CELSIUS"
End If
End Sub
Private Sub Command2_Click()
Text1.Text = "0"
Text1.SetFocus
Label4.Caption = ""
Label5.Caption = ""
End Sub
Private Sub Command3_Click()
Unload Me
End
End Sub