VB.NET

단위변환

2014.02.03

* Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox2.Text = TextBox1.Text * 0.003281
TextBox3.Text = TextBox1.Text * 0.03937
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If Not (IsNumeric(TextBox1.Text) Or TextBox1.Text = "") Then
MsgBox("값을 립력하세요", vbExclamation, "알림")
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = vbEmpty
TextBox2.Text = vbEmpty
TextBox3.Text = vbEmpty
End Sub
End Class 

단위변환시 원하는 값을 곱해 단위를 구하시면 됩니다