Option Explicit On
Option Strict On
Public Class frmCOnvert
Dim input As Long
Dim output As String
Private Sub btnConvert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnConvert.Click
If IsNumeric(txtinout.Text) Then
input = CLng(txtinout.Text)
End If
If RadBin.Checked = True Then
output = Convert.ToString(input, 2)
txtinout.Text = output
End If
If RadOct.Checked = True Then
output = Convert.ToString(input, 8)
txtinout.Text = output
End If
If radHex.Checked = True Then
output = Convert.ToString(input, 16)
txtinout.Text = output
End If
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtinout.Clear()
input = 0
output = CStr(0)
End Sub
Private Sub btnZero_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnZero.Click
txtinout.Text &= "0"
End Sub
Private Sub BtnPoint_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles BtnPoint.Click
txtinout.Text &= "."
End Sub
Private Sub btn1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn1.Click
txtinout.Text &= "1"
End Sub
Private Sub btn2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn2.Click
txtinout.Text &= "2"
End Sub
Private Sub btn3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn3.Click
txtinout.Text &= "3"
End Sub
Private Sub btn4_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn4.Click
txtinout.Text &= "4"
End Sub
Private Sub btn5_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn5.Click
txtinout.Text &= "5"
End Sub
Private Sub btn6_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn6.Click
txtinout.Text &= "6"
End Sub
Private Sub btn7_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn7.Click
txtinout.Text &= "7"
End Sub
Private Sub btn8_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn8.Click
txtinout.Text &= "8"
End Sub
Private Sub btn9_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn9.Click
txtinout.Text &= "9"
End Sub
End Class