1、Public Class Form2 Function TranDec$(ByVal m%, ByVal r%) Dim c% TranDec = Do While m 0 c = m Mod r If c 9 Then TranDec = Chr(c - 10 + 56) & TranDec Else TranDec = c & TranDec End If m = m r Loop End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handle
2、s Button1.Click Dim m0%, r0% m0 = Val(TextBox1.Text) r0 = Val(TextBox2.Text) If r0 16 Then MsgBox(数制超出范围) End If TextBox3.Text = TranDec(m0, r0) End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub Butto
3、n2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox4.Text = Oct(TextBox1.Text) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox5.Text = Hex(TextBox1.Text) End Sub Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Focus() End SubEnd Class