
conversion simple
Publicado por vicente wray (18 intervenciones) el 23/08/2010 11:45:04
megustaria saber si ay alguna manera de hacer un conversion mas eficaz y profesional
esta me parece un poco basica
pongo la que yo hago por si me pueden ayudar a mejorarla gracias
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If RadioButton1.Checked = True Then
Label1.Text = Format(TextBox1.Text / 166.386, "##,###.##") & " €"
Label4.Text = "Conversion Correcta"
Button1.Text = "Convertir a €"
End If
If RadioButton2.Checked = True Then
Label1.Text = Format(TextBox1.Text * 166.386, "##,###.##") & " Pts"
Label4.Text = "Conversion Correcta"
Button1.Text = "Convertir a Pesetas"
End If
Catch ex As Exception
Media.SystemSounds.Exclamation.Play()
Label4.Text = " Cantidad Esta Vacio o son Caracteres no Validos"
TextBox1.Focus()
End Try
End Sub
esta me parece un poco basica
pongo la que yo hago por si me pueden ayudar a mejorarla gracias
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If RadioButton1.Checked = True Then
Label1.Text = Format(TextBox1.Text / 166.386, "##,###.##") & " €"
Label4.Text = "Conversion Correcta"
Button1.Text = "Convertir a €"
End If
If RadioButton2.Checked = True Then
Label1.Text = Format(TextBox1.Text * 166.386, "##,###.##") & " Pts"
Label4.Text = "Conversion Correcta"
Button1.Text = "Convertir a Pesetas"
End If
Catch ex As Exception
Media.SystemSounds.Exclamation.Play()
Label4.Text = " Cantidad Esta Vacio o son Caracteres no Validos"
TextBox1.Focus()
End Try
End Sub
Valora esta pregunta


0