Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Disabling existing controls in a dialog

Disabling existing controls in a dialog

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luis E Cuadrado
    wrote on last edited by
    #1

    Hello Everybody: I was wondering if anyone can tell me how to disable existing control inside a Dialgo box. Ok this is what I want to do. I have a check box control and under that check box I have 2 combo boxes and 2 buttons. What I want to do is if I check the check box, the controls under the check box become enabled. And when I uncheck the check box, the controls under the check box become disabled. Any suggestions are more than welcome. Best regards, Luis E. Cuadrado :0)

    T R 2 Replies Last reply
    0
    • L Luis E Cuadrado

      Hello Everybody: I was wondering if anyone can tell me how to disable existing control inside a Dialgo box. Ok this is what I want to do. I have a check box control and under that check box I have 2 combo boxes and 2 buttons. What I want to do is if I check the check box, the controls under the check box become enabled. And when I uncheck the check box, the controls under the check box become disabled. Any suggestions are more than welcome. Best regards, Luis E. Cuadrado :0)

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Handle BN_CLICK for checkbox. In the event handler, use EnableWindow to switch other controls on/off. Tomasz Sowinski -- http://www.shooltz.com

      What is "scratch" and why can everything be made from it?

      L 1 Reply Last reply
      0
      • T Tomasz Sowinski

        Handle BN_CLICK for checkbox. In the event handler, use EnableWindow to switch other controls on/off. Tomasz Sowinski -- http://www.shooltz.com

        What is "scratch" and why can everything be made from it?

        L Offline
        L Offline
        Luis E Cuadrado
        wrote on last edited by
        #3

        Hi: Sorry for my ignorance, but does EnableWindow works with controls as well? thanks, Luis E. Cuadrado :0)

        T 1 Reply Last reply
        0
        • L Luis E Cuadrado

          Hi: Sorry for my ignorance, but does EnableWindow works with controls as well? thanks, Luis E. Cuadrado :0)

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          Luis E. Cuadrado wrote: does EnableWindow works with controls as well? Controls *are* windows. EnableWindow will work. Tomasz Sowinski -- http://www.shooltz.com

          What is "scratch" and why can everything be made from it?

          1 Reply Last reply
          0
          • L Luis E Cuadrado

            Hello Everybody: I was wondering if anyone can tell me how to disable existing control inside a Dialgo box. Ok this is what I want to do. I have a check box control and under that check box I have 2 combo boxes and 2 buttons. What I want to do is if I check the check box, the controls under the check box become enabled. And when I uncheck the check box, the controls under the check box become disabled. Any suggestions are more than welcome. Best regards, Luis E. Cuadrado :0)

            R Offline
            R Offline
            Renjith Ramachandran
            wrote on last edited by
            #5

            Create Control Variables Using the ClassWizard and Call Your_Control_Variable.EnableWindow(FALSE) ; To Disable the Control and Your_Control_Variable.EnableWindow(TRUE) ; to enable the Window and using Classwizard make a event Handler Corresponding to BN_CLICKED message of u check box and ur checkbox_control_variable.GetCheck() fuction to determine the check state..id it is true box checked else unchecked..handle the situation as u like... Renjith-CPian.

            L 2 Replies Last reply
            0
            • R Renjith Ramachandran

              Create Control Variables Using the ClassWizard and Call Your_Control_Variable.EnableWindow(FALSE) ; To Disable the Control and Your_Control_Variable.EnableWindow(TRUE) ; to enable the Window and using Classwizard make a event Handler Corresponding to BN_CLICKED message of u check box and ur checkbox_control_variable.GetCheck() fuction to determine the check state..id it is true box checked else unchecked..handle the situation as u like... Renjith-CPian.

              L Offline
              L Offline
              Luis E Cuadrado
              wrote on last edited by
              #6

              Oh, I see. I'm giving it a try. I'll let you know the results. Thank you for your replies. later,

              1 Reply Last reply
              0
              • R Renjith Ramachandran

                Create Control Variables Using the ClassWizard and Call Your_Control_Variable.EnableWindow(FALSE) ; To Disable the Control and Your_Control_Variable.EnableWindow(TRUE) ; to enable the Window and using Classwizard make a event Handler Corresponding to BN_CLICKED message of u check box and ur checkbox_control_variable.GetCheck() fuction to determine the check state..id it is true box checked else unchecked..handle the situation as u like... Renjith-CPian.

                L Offline
                L Offline
                Luis E Cuadrado
                wrote on last edited by
                #7

                Well, I just did what you guys recommended me and it works. Thank you very much Tomasz Sowinski and Renjith - CPian for all you help. Have a wonderful day. Best regards, Luis E. Cuadrado :0)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups