home *** CD-ROM | disk | FTP | other *** search
-
- ' Copyright (c) 1994 by Barth Riley
-
- Declare Function SendMessage Lib "user" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wp As Integer, lp As Any) As Long
-
- Sub SetTBReadOnly (tbCtl As TextBox, ByVal fReadOnly As Integer)
- '----------------------------------------------------------
- ' Description: Sets an edit control to read-only
- ' if fReadOnly is true, or to
- ' read/write when false.
- ' Date Modified: Jan 1st, 1994
- ' Project: Read-only Data Demo
- ' Parameters:
- ' tbCtl (TextBox) edit control to set/reset
- ' fReadOnly (Flag) When true, sets tbCtl to
- ' read-only mode
- ' Calls SendMessage
- '--------------------------------------------------------
- '---Constant Declarations
- Const WM_USER = &H400
- Const EM_SETREADONLY = WM_USER + 31
- '---DIM Variables
- Dim intRet As Integer
- '---CODE Begins
- intRet = SendMessage(tbCtl.hWnd, EM_SETREADONLY, fReadOnly, 0&)
- '---SetTBReadOnly ends
- End Sub
-
-