title: All requirements for a Vertical Scrollbar to show up: Why is it Hiding?
body: <p>What are all the requirements to make a vertical scrollbar to show up? It seems very random. </p>
  
  <p>I tried:</p>
  
  <pre><code>HorzScrollBar.Range := 10000; // set the range to an higher number
  VertScrollBar.Range := 10000; // set the range to an higher number
  ShowScrollBar(Handle, SB_BOTH, True);
  </code></pre>
  
  <p>In combination with adjusting ranges in object inspector as well as AutoScroll on/off, client height (of the form). I think I had all combinations possible in the past hour. It seems like it doesn't matter what I do, the scrollbar is not coming back anymore - where it first showed up when I randomly re-adjusted some settings (to the same settings?). </p>
  
  <p>What I am trying to accomplish: when I press a button the form shows up and should show on the right of the screen, with the following:</p>
  
  <pre><code>Form1.Height := Screen.Height - 40;
  Form1.Left := Screen.Width - 423;
  Form1.Show;
  </code></pre>
  
  <p>The form is an options menu, where all the options fit perfectly on the screen I am using now. However, I made a panel that will become longer (more height) and push all other options down when a certain option is clicked. So THEN is when I need that scrollbar, as settings start falling off the screen. </p>
  
  <p>Ideally it would only show up when those options where clicked and disappear when it is no longer necessary, but somehow it is not showing up at all - it doesn't matter what sizes or ranges I give the form. </p>
  
  <p>What other option I am forgetting to set/what other dependents AutoScroll or just VerticalScrollbar have in order to show up when needed?</p>
  
  <hr>
  
  <p>With ShowMessage function I have some more information. I created a button which performed the following:</p>
  
  <pre><code>procedure TfrmInstellingenMenu.Button1Click(Sender: TObject);
  begin
  VertScrollBar.Visible := true;
  ShowMessage('Visible? ' + BoolToStr(VertScrollBar.IsScrollBarVisible)); 
      //returns "Visible? -1". -1 is TRUE*, so yes (*tnx Ken)
  ShowMessage('Autoscroll turned on? ' + BoolToStr(AutoScroll));
      //returns "Autoscroll turned on? 0". 0 is False, so no
  ShowMessage('Range=' + IntToStr(VertScrollBar.Range));
      //returns "Range=8000". 
  end;
  </code></pre>
  
  <p>So although the VertScrollbar is turned on, AutoScroll (because of that) is automatically turned off plus the range is by far enough, why is it still hiding?</p>
  
  <p>Edit2:
  Some more details:
  It is a VCL form, borderstyle is set to bsSizable. In the form there are basically only 2 panels of the same size. They have both constrained sizes and are aligned to left and right at start. A button aligns them to Top and to Bottom. When I set the button to set them both to align to Top, it does not matter what I set the form Height anymore (probably cause of the constraints of the two panels). It becomes too high for my computer screen though and a part of the form disappears off the screen. When I set one to align to top and the other to Bottom the whole form is on the screen, but the two panels overlap each other. Ah, and offcourse still no scrollbar.</p>