Results 1 to 2 of 2

Thread: API Enable

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Posts
    30
    anyone know witch API to use when I want to enable/disable a command-button just with API. SetWindowLong, SendMessage or some other API?

  2. #2
    Guest
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width