title: .NET winforms application controls turn to red x's
body: <p>I've deployed a C#.net 2.0 application to a Windows XP SP2 machine and during certain events a lot of the form controls turn to red X's. (Buttons, labels, etc...). I've pasted one of the procedures below that causes the problem. Since I can't reproduce it on the development machine, I can only guess that the problem is either with the threading or painting.</p>
  
  <pre><code> private void SearchExistingPeople()
          {
              try { if (_dal == null) { _dal = new DataAccessLayer(); } }
              catch (Exception ex) { throw new Exception("Error creating DataAccessLayer: " + ex.Message); }
  
              Thread oThread = new Thread(ShowPleaseWait);
              oThread.Start();
  
              try
              {
                  PersonDS _dsPerson = _dal.SearchExistingPersons(dtbSearchDOB.Value, txtSearchFName.Text, txtSearchLName.Text, txtSearchSSN.Text, txtSearchAKA.Text, chkDOBSearch.Checked);
                  dgvPeople.DataSource = _dsPerson;
                  dgvPeople.DataMember = "People";
  
                  dgvPeople.Columns["PersonID"].Visible = false;
              }
              catch (Exception ex)
              { MessageBox.Show("Error in SearchExistingPeople: " + ex.Message); }
              finally
              { 
                  if (_dal != null) { _dal = null; }
                  oThread.Abort();
                  oThread = null;
              }
          }
  </code></pre>