단위변환
*
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

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

이 게시물을

댓글'1'
함흥처사
  • 2014.02.04
  • 수정: 2014.02.04 03:59:37

 Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox2.Text = TextBox1.Text + 1
        TextBox3.Text = TextBox1.Text - 2
        TextBox4.Text = TextBox1.Text * 3
        TextBox5.Text = TextBox1.Text / 4
    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
        TextBox4.Text = vbEmpty
        TextBox5.Text = vbEmpty
    End Sub
End Class

 

단위변환.jpg

이 댓글을

공유하기

SEARCH

MENU NAVIGATION