title: how to change background color of a static text control (when a button is pushed or in a timer) in mfc?
body: <p>I know it can be done with OnCtlColor(), but it changes colors when the form is being loaded and the static texts are to be drawn, I want to do it after form is loaded, with a timer maybe, I searched for a solution but I didn't find a clear one, this is what I wrote:</p>
  
  <pre><code>void CTabFive::OnBnClickedButton1()
  {
      // TODO: Add your control notification handler code here
      CWnd* pWnd = this-&gt;GetDlgItem(IDC_Chromosome1);
      CDC* dc = pWnd-&gt;GetDC();
      dc-&gt;SetBkColor(RGB(200,0,0));
      pWnd-&gt;Invalidate();
      pWnd-&gt;UpdateWindow();
      Invalidate();
      UpdateWindow();
      //flag = true;
  }
  </code></pre>