title: How to wait for line of code to finish before moving onto the next line
body: <p>I'm using Visual Basic 2010, and within my form shown sub I need two buttons to be pressed , however I need the first button's code to complete before the moving on to pressing the next button. Is there any way to allow this to happen? Thanks :)</p>
  
  <pre><code>  Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
  
      BindingNavigatorMoveLastItem.PerformClick()))
  
     'I need this next button click to be carried out after the one above has completely finished
  
      BindingNavigatorMovePreviousItem.PerformClick()))
  
  End Sub
  </code></pre>