#1
  1. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Austria
    Posts
    17
    Rep Power
    0

    (De-)Activating Dialog Elements in Visual C++ 6.0


    Hi folks !

    I have a little problem --> I want to set some items in a Visual C++ dialog active or inactive according to a switch in the same dialog.

    I've found the CWnd::SetProperty method, but I didn't manage to get a list of the possible DISPIDs to be set.

    Does anybody know where I can get such a list, or how the function call would look like to activate or deactivate a certain element of the dialog (maybe a check button for example) ?

    TIA,
    Wolfgang
  2. #2
  3. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    If you just want to turn on or off some controls on a dialog then try

    EnableWindow() //disables or enables control

    or

    ShowWindow()//shows or hides from view
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa
  4. #3
  5. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Austria
    Posts
    17
    Rep Power
    0
    Thanks for the tip, but these functions seem to affect the whole window ... :)

    I just have to enable/disable certain elements in the window, the rest should remain unaffected ...
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Romania
    Posts
    3
    Rep Power
    0

    Re: (De-)Activating Dialog Elements in Visual C++ 6.0


    Originally posted by walliscw
    Hi folks !

    I have a little problem --> I want to set some items in a Visual C++ dialog active or inactive according to a switch in the same dialog.

    I've found the CWnd::SetProperty method, but I didn't manage to get a list of the possible DISPIDs to be set.

    Does anybody know where I can get such a list, or how the function call would look like to activate or deactivate a certain element of the dialog (maybe a check button for example) ?

    TIA,
    Wolfgang
    Code:
    GetDlgItem(IDC_BTN)->EnableWindow(TRUE/*FALSE*/);
  8. #5
  9. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Austria
    Posts
    17
    Rep Power
    0
    Code works ...

    Thanks very much for your help ... :)
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Romania
    Posts
    3
    Rep Power
    0
    no problem

IMN logo majestic logo threadwatch logo seochat tools logo