Private Sub OCT_Click()
Dim n As Long
n = CInt(Text1.Text)
Label1.Caption = ""
Do
Label1.Caption = n Mod 8 & Label1.Caption
n = n \ 8
Loop While n > 0
Label1.Caption = "八进制:" & Label1.Caption
End Sub
Private Sub HEX_Click()
Dim n As Long, t As Long
n = CInt(Text1.Text)
Label2.Caption = ""
Do
t = n Mod 16
If t < 10 Then
Label2.Caption = t & Label2.Caption
Else
Label2.Caption = Chr(t + 55) & Label2.Caption
End If
n = n \ 16
Loop While n > 0
Label2.Caption = "十六进制:" & Label2.Caption
End Sub