[VB6 ] 初學者問題

看板Visual_Basic作者 (.......)時間19年前 (2005/08/27 20:57), 編輯推噓2(201)
留言3則, 2人參與, 最新討論串1/1
Private Sub HScroll1_Change() Dim thou As Integer Dim hund As Integer Dim dec As Integer Dim uni As Integer Dim tem1 As Integer Dim tem2 As Integer uni = HScroll1.Value Mod 16 tem1 = HScroll1.Value / 16 dec = tem1 Mod 16 tem2 = tem1 / 16 hund = tem2 Mod 16 thou = tem2 / 16 Label3.Caption = uni Label2.Caption = tem1 Label4.Caption = HScroll1.Value End Sub ---------------------------------------------------------------------- 以上, 為何當HScroll1.value數到9的時候,tem1就變1了? 應該是HScroll1.value數到16的時候才會加1啊? 是哪裡出問題了?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.28.161

210.58.156.43 08/27, , 1F
改用整數除法運算子吧
210.58.156.43 08/27, 1F

140.113.28.161 08/27, , 2F
喔..我把 / 和 \ 搞混了......
140.113.28.161 08/27, 2F

140.113.28.161 08/27, , 3F
太感謝了
140.113.28.161 08/27, 3F
文章代碼(AID): #1346CsND (Visual_Basic)
文章代碼(AID): #1346CsND (Visual_Basic)