title: Hide empty space behind invisible list box items
body: <p>I can see <a href="http://codeverge.com/embarcadero.delphi.firemonkey/hiding-without-deleting-listbox/1047282" rel="nofollow">other people have had this issue</a>, and the proposed solution is not working for me.</p>
  
  <p>I have a list box with a number of static items populated in design-time, and in run-time, some list box items have their visibility changed. However, those items which are not visible leave an empty space in the list box where that item belongs. It's proposed to set the invisible item height to 0, and it's apparently worked for people, but it's not working for me.</p>
  
  <p>This is a common function I wrote to accommodate for this:</p>
  
  <pre><code>procedure FixHidden(AListBox: TListBox);
  var
    X: Integer;
    I: TListBoxItem;
  begin
    for X := 0 to AListBox.Count-1 do begin
      I:= AListBox.ItemByIndex(X);
      if I.Visible then
        I.Height:= AListBox.ItemHeight
      else
        I.Height:= 0;
    end;
  end;
  </code></pre>
  
  <p>While stepping through the code, I can confirm that after <code>I.Height:= 0;</code> the <code>Height</code> is in fact 0. However, the problem still persists, and there's still an empty void in the list box, as if the list box control ignores what height I set the item.</p>
  
  <p>How can I make invisible items truly hidden from the list box including this empty space behind it, without deleting these items? My app has many different list box controls with the same issue, so a global solution would be ideal.</p>
  
  <p>NOTE: This is using Windows 32 as a platform.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I did a few more trials, and discovered something. In design-time, the list box items <code>Height</code> property defaults to the parent list box's <code>ItemHeight</code> property. If I change the <code>Height</code> of a specific item in design-time, it immediately reverts back to what it was before. So the question then becomes... why is Firemonkey reverting <code>TListBoxItem.Height</code> every time I change it?</p>