VB程序十进制转化为八进制、二进制、十六进制(同一个程序里)
发布网友
发布时间:2022-05-01 08:03
我来回答
共1个回答
热心网友
时间:2022-06-26 11:47
您可以使用下列代码来实现~
Private
Sub
Text1_Change()
n
=
Val(Text1.Text)
Label4.Caption
=
Str(n)
+
"进制数"
End
Sub
Private
Sub
Text2_Change()
num
=
Val(Text2.Text)
End
Sub
Private
Sub
trans(vary()
As
String,
st()
As
String)
Dim
r
As
Integer
Dim
k
As
Integer
k
=
0
Do
r
=
num
Mod
n
k
=
k
+
1
ReDim
Preserve
vary(k)
vary(k)
=
st(r)
num
=
num
\
n
Loop
Until
num
=
0
End
Sub
望您能满意