VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 如何不用API使文本框属性只读?
发表评论(0)作者:不详, 平台:VB6.0+Win98, 阅读:8319, 日期:2001-10-11
如何不用API使文本框属性只读?
以下两种方法都可实现:

Private Sub Text1_GotFocus()
  Text1.Locked = True
End Sub
Private Sub Text1_LostFocus()
  Text1.Locked = False
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, _
Shift As Integer)
  KeyCode = 0
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
  KeyAscii = 0
End Sub