|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Tornando um controle somente leitura em RunTime
|
|
|
|
Postada em 7/10/2003 por ^HEAVY-METAL^
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _ (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _ ByVal lpsz2 As String) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As Long Private Const EM_SETREADONLY = &HCF
Public Sub SetReadOnly(ByRef ObjX As Object, ObjBool As Boolean) Dim hwndEdit As Long hwndEdit = FindWindowEx(ObjX.hwnd, 0&, vbNullString, vbNullString) If hwndEdit 0 Then SendMessage hwndEdit, EM_SETREADONLY, ObjBool, 0& End If End Sub
T+,
|
|
|
|
|