CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    how to enable a button in a dialogbar?

    I have a button in my dialogbar which is grayout. How do I enable the button?

    I added a handler to handle the event of the button being clicked. What else I should do?

    Thanks!


  2. #2
    Join Date
    May 1999
    Posts
    116

    Re: how to enable a button in a dialogbar?

    that should be enough.... where have you added the handler (i.e. to which class)?


  3. #3
    Join Date
    May 1999
    Posts
    82

    Re: how to enable a button in a dialogbar?

    EnableWindow(TRUE); enables a button and EnableWindow(FALSE); disables a button.


  4. #4
    Guest

    Re: how to enable a button in a dialogbar?

    Please add a variable to the button thru class wizard . Suppose the name is
    m_Button. Then in your code you can write
    m_Button.EnableWindow(TRUE);//to enable the window
    m_Button.EnableWindow(FALSE);//to disable the window
    reply to [email protected]


  5. #5
    Join Date
    Jun 1999
    Location
    SLC, Utah
    Posts
    155

    Re: how to enable a button in a dialogbar?

    When you decide to enable the button you could say

    CButton* button = (CButton*)dialogBar.GetDlgItem(IDC_BUTTON_RESOURCE_NAME_HERE);
    button->EnableWindow(true);



    correspondingly if you needed to disable you would replace the true with a false


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

Featured