回覆列表
  • 1 # 使用者2458114238191884

    Private Sub Text1_Change()

    Dim n

    If Len(Text1) > 0 And IsNumeric(Text1) Then

    n = Val(Text1)

    DEC_to_BIN n

    DEC_to_OCT n

    DEC_to_HEX n

    Else

    Text1 = ""

    End If

    End Sub

    Sub DEC_to_BIN(ByVal Dec)

    Label5.Caption = ""

    Do While Dec > 0

    Label5.Caption = Dec Mod 2 & Label5.Caption

    Dec = Dec \ 2

    Loop

    End Sub

    Sub DEC_to_OCT(ByVal Dec)

    Label6.Caption = ""

    Do While Dec > 0

    Label6.Caption = Dec Mod 8 & Label6.Caption

    Dec = Dec \ 8

    Loop

    End Sub

    Sub DEC_to_HEX(ByVal Dec)

    Dim a As String

    Label7.Caption = ""

    Do While Dec > 0

    a = CStr(Dec Mod 16)

    Select Case a

    Case "10": a = "A"

    Case "11": a = "B"

    Case "12": a = "C"

    Case "13": a = "D"

    Case "14": a = "E"

    Case "15": a = "F"

    End Select

    Label7.Caption = a & Label7.Caption

    Dec = Dec \ 16

    Loop

    End Sub

  • 中秋節和大豐收的關聯?
  • 如果你為對方付出了一切,但是最後被對方一腳踢開,你會怎麼辦?