title: How to change the operation in a subprogram in c#?
body: <p>I wrote a code that makes a picturebox move when I click on a button. For example, the right button uses this code:</p>
  
  <pre><code>    private void btnRight_Click(object sender, EventArgs e)
      {
      //move right
      if (stopThePlayer == true)
      {
          return;
      }
      else
      {
          x = x + speed;
          RightBoundary();
          MovingSubprograms();
      }
  }
  </code></pre>
  
  <p>Don't worry about the subprograms. All I want  to know is is there a way that I can only change <code>x = x + speed;</code> part. For example, in the left button, I want to make it <code>x = x - speed</code>. So basically I'll just create a subprogram and only change that code. Is that possible? Thanks.</p>