看板 Visual_Basic 關於我們 聯絡資訊
 我想要寫一個輸入密碼的程式,  密碼輸入錯誤三次就結束系統,  密碼對了就進入另一個form,  程式碼如下: Dim flag As Integer Private Sub Text1_KeyPress(KeyAscii As Integer) flag = 0 While flag < 3 If KeyAscii = 13 Then If Text1.Text = "12345" Then Form8.Visible = False Form1.Visible = True Else flag = flag + 1 Print "密碼輸入錯誤,請重新輸入。" End If End If Wend Print "密碼輸入錯誤已達三次,謝謝光臨歡迎下次再來。" End End Sub 執行時無法在text1輸入,只要按一個鍵, 整個程式就當掉。 請問問題出在哪,先謝謝回答的人。:D --          ★我不是小女孩 但渴望被寵壞★ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 222.250.195.109