06.08.2013 Views

03 林家民

03 林家民

03 林家民

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

題目說明:在表單上佈建兩個文字方塊控制物件,並讓使用者輸入於其中,並<br />

觀察其變化。<br />

檔案名稱:<strong>03</strong> \ ch3 \ P.105<br />

表單:<br />

程式碼:<br />

Private Sub Command1_Click()<br />

MsgBox "你的帳號為" & Text2.Text, , "登入成功"<br />

End Sub<br />

Private Sub Command2_Click()<br />

Text1.Text = " "<br />

Text2.Text = ""<br />

Text1.SetFocus<br />

End Sub<br />

Private Sub Command3_Click()<br />

End<br />

End Sub<br />

Private Sub Text1_LostFocus()<br />

If Len(Text1.Text) 6 Then<br />

MsgBox "帳號應為 6 個數!", , "請重新輸入"<br />

End If<br />

End Sub<br />

執行結果:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!