title: How can I refer to a control whose name is determined at runtime?
body: <p>As a kind of self-study exercise, I've made a form which contains six panels in a 2x3 rectangle and I want them to switch between visible and invisible one after another. I'm trying to do so by using a for loop of some kind. I could of course write something like:</p>
  <pre><code>Panel1.Visible := true;
  Panel1.Visible := false;
  Panel2.Visible := true;
  Panel2.Visible := false;
  Panel3.Visible := true;
  etc. etc.
  </code></pre>
  <p>But this takes quite a lot of typing and is pretty inefficient when I decide I want it to wait for 100ms between each step. For example, I'd then have to edit all the six steps to wait. This is doable for six steps, but maybe another time I want to do it a hundred times! So I'm thinking there must also be a way to use a for loop for this, where a variable varies from 1 to 6 and is used in the object identifier. So it would something like this:</p>
  <pre><code>for variable := 1 to 6 do begin
  Panel + variable.Visible := true;
  Panel + variable.Visible := false;
  end;
  </code></pre>
  <p>Now, this obviously doesn't work, but I hope somebody here can tell me if this is in fact possible and if yes, how. Maybe I can use a string as the identifier? My explanation is probably pretty bad because I don't know all the technical terms but I hope the code explains something.</p>