title: Disabling (Greying out) multiple GUI Items in C++
body: <p><strong>Question:</strong>
  I am looking for an effective way to disable(grey) <strong>mutiple</strong> items in a MFC C++ application.  Depending on if the user is signed into a SQL Server or Oracle account, I wish to disable a section of GUI items.</p>
  
  <p><strong>What I have tried:</strong>
  I have used the following code to disable one of my two "Create User" buttons.</p>
  
  <pre><code>if(checkIsSQLServer())
  {
      CWnd *oraCreateUser = GetDlgItem(BTN_ORA_CREATE);
      oraCreateUser-&gt;EnableWindow(false);  //Disable Oracle "Create User" button
  }
  else
  {
      CWnd *sqlCreateLogin = GetDlgItem(BTN_SQL_CREATE); 
      sqlCreateLogin-&gt;EnableWindow(false);  //Disable SQL Server "Create User" button.
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/iPzVm.png" alt="enter image description here">
  .</p>
  
  <p>This code works perfectly, however it only disables the button.  I wish to disable all items within either groupbox.</p>
  
  <p>Do I need to create a <code>CWnd*</code> object for every item I wish to disable?  Is there a more effective way, such as a way to disable all items that are contained within a group box?</p>