title: Can not click button when a method running
body: <pre><code>   private void AddMyScrollEventHandlers()
     {
         VScrollBar vScrollBar1 = new VScrollBar();
     }
  
     private void button1_Click(object sender, EventArgs e)
     {
         while (true)
         {
             if (vScrollBar1.Value + 1 &lt; vScrollBar1.Maximum)
             {
                 vScrollBar1.Value = vScrollBar1.Value + 1;    
                 label1.Text = vScrollBar1.Value.ToString();                       
             }       
             else 
             {         
                 break;      
             }
  
             System.Threading.Thread.Sleep(200);
         }
     }
  
     private void button2_Click(object sender, EventArgs e)
     {
         // vScrollBar1.Scroll
     }
  </code></pre>
  
  <p>I am new in C#. I was working on scroll. What I wanted here is, if anyone click button1 then scroll automatically move to the end and I wanted to show gradual value in label1. Also when someone click button2 scrolling stop.</p>
  
  <p>Now the problem is label1 do not show gradual change in value. It shows value once when the scrolling stop.</p>
  
  <p>Also when scrolling continue i,e when while loop is working I can not click on button2. Actually I can not click on the form even.</p>
  
  <p>Someone please give me some idea how to do this.</p>