為ㄌ要期末考<br>而且我又是VB的初學者<br>有誰能教我加減乘除得程式碼<br>謝謝!!<br>
小算盤+小畫家=title? 做加減乘除的程式可以有很多方式, 這裡用一個比較簡單的: 兩個TextBox:Text1,Text2 四個CommandButton:Command1(0 to 3) 程式碼: Private Sub Command1_Click(Index as Interger) Select case Index Case 0 MsgBox Val(Text1)+Val(Text2) Case 1 MsgBox Val(Text1)-Val(Text2) Case 2 MsgBox Val(Text1)*Val(Text2) Case 3 If Val(Text2)=0 Then Exit Sub End If MsgBox Val(Text1)/Val(Text2) End Select End Sub