title: C# Winforms - When are scrollbars for a Control initialized?
body: <p>Here is the situation:</p>
  
  <p>I am trying to control flowLayoutControl's scroll bar from devexpress controls VerticalScroll.</p>
  
  <p>Now - flowLayoutControl with autoscroll = true. I added a new verticalscroll control and dock it to Right. So now the Devexpress Vertical Scroll control is right on top of FlowLayout scrollbar. </p>
  
  <p>Also the FlowLayoutPanel vertical scroll does not hide when following code is run:</p>
  
  <pre><code>    spotWinFlowLayout1.VerticalScroll.Visible = false
  </code></pre>
  
  <p>I have setup the following event handlers:</p>
  
  <pre><code>    private void spotWinFlowLayout1_Resize(object sender, EventArgs e)
      {
          SetupVerticalScrollBar();
      }        
  
      private void SetupVerticalScrollBar()
      {
          vScrollBar1.Minimum = spotWinFlowLayout1.VerticalScroll.Minimum;
          vScrollBar1.Maximum = spotWinFlowLayout1.VerticalScroll.Maximum;
          vScrollBar1.LargeChange = spotWinFlowLayout1.VerticalScroll.LargeChange;
          vScrollBar1.SmallChange = spotWinFlowLayout1.VerticalScroll.SmallChange;            
      }
  
      private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
      {
          spotWinFlowLayout1.VerticalScroll.Value = e.NewValue;
      }
  </code></pre>
  
  <p>Everything is working fine except when on form Load there is already a scrollbar on flowLayoutControl,
  <strong>spotWinFlowLayout1.VerticalScroll.XXX properties not set yet</strong>. So both the scrollbars are out of Sync. But as soon as I resize the form both get Sync.</p>
  
  <p>So when is scrollbar for the FlowLayoutPanel initialized?</p>