anyone know witch API to use when I want to enable/disable a command-button just with API. SetWindowLong, SendMessage or some other API?
Printable View
anyone know witch API to use when I want to enable/disable a command-button just with API. SetWindowLong, SendMessage or some other API?
The EnableWindow API should do it.
Code:Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Sub Command1_Click()
'Disable Command1. Pass True instead of False to enable it
EnableWindow Command1.hwnd, False
End Sub