Private Sub Command1_Click()
Dim n As Integer, t As Integer
Dim r As Integer, c As Integer
Dim s As String
n=Val(Text1.Text)
s=””
Do While t>0
r=(t+1) Mod 2
t=t\2
c=c+1
Loop
For i=1 To 8-c
s=CStr(1)+s
Next i
Label1.Caption=” 十进制数”+CStr(n)+”的二进制反码为”+s
End Sub