博騰 發問時間: 電腦與網際網路程式設計 · 10 年前

vb6 如何在小算盤裡加小數點

請問要如何在

Private Sub Command4_Click()

End Sub

裡面加入小數點的程式碼

Dim o1 As Integer, o2 As Integer

Dim s As Integer '全域宣告s為整數

Dim m As Boolean '全域宣告c為布林變數Private Sub Command1_Click(Index As Integer)If m = True Then '如果c為真實的話將Text1清除空白

Text1.Text = ""

m = False

End If

Text1.Text = Str(Val(Text1.Text & Str(Index)))

End SubPrivate Sub Command2_Click(Index As Integer)

s = Index

m = True

o1 = Val(Text1.Text)

End SubPrivate Sub Command3_Click()

o2 = Val(Text1.Text)

Select Case (s)

Case 0

Text1.Text = o1 + o2

Case 1

Text1.Text = o1 - o2

Case 2

Text1.Text = o1 * o2

Case 3

Text1.Text = o1 / o2

End Select

End SubPrivate Sub Command4_Click()

End SubPrivate Sub Command5_Click()

Text1.Text = "0"

m = False

o1 = 0

o2 = 0

s = -1

End Sub

1 個解答

評分
  • 10 年前
    最佳解答

    無人幫無人幫無人幫無人幫無人幫無人幫

還有問題?馬上發問,尋求解答。