Results 1 to 7 of 7

Thread: how to Enable/Disable buttons using API

Hybrid View

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Bahrain
    Posts
    41
    There is a disabled button in a form, i want to make this button enabled, ofcourse using API

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Code:
    EnableWindow button1.hWnd
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    I keep forgeting it is not C++
    Code:
    Declare Function EnableWindow Lib "user32" Alias "EnableWindow" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Bahrain
    Posts
    41
    Thanks... it works

    except one button (which I want to enable it), any idea ?

  5. #5
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Try
    Code:
    EnableWindow button1.hWnd, 1
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  6. #6
    Megatron
    Guest
    If it helps for you to understand, you can use the constants True and False, for enabling (True) and disabling (False).

  7. #7

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Bahrain
    Posts
    41
    Still it doesn’t work !

    Actually, it works for all buttons except one, this button located in a splash window from a demo program, this demo is time limited, button caption is “Try it” but it is disabled, I tried all the ways to run the demo again but no use, I set the time back, I even delete the windows and program files directory, and install windows from scratch, when I install the program again it says “Security problem”, it seams the it stored some data in the root directory or something like that..

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