Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. public void StepImage(string direction, PictureBox c)
  2.         {
  3.             int include1 = 0;
  4.             if (numb.Length == 1)
  5.             {
  6.                 include1 = Convert.ToInt32(numb[0].ToString());
  7.             }
  8.             else
  9.             {
  10.                 include1 = Convert.ToInt32(numb[0].ToString() + numb[1].ToString());
  11.             }
  12.  
  13.             if (direction == "right")
  14.             {
  15.                 if (include1 < theory.Count - 1)
  16.                 {
  17.                     c.Image = theory[include1+1];
  18.                     numb = include1.ToString();
  19.                     leftbtn.Enabled = true;
  20.                     if (include1 + 1 == theory.Count - 1)
  21.                     {
  22.                         rightbtn.Enabled = false;
  23.                     }
  24.                 }
  25.             }
  26.  
  27.             else
  28.             {
  29.                 if (include1 > 0)
  30.                 {
  31.                     c.Image = theory[include1 - 1];
  32.                     numb = include1.ToString();
  33.                     rightbtn.Enabled = true;
  34.                     if (include1 - 1 == 0)
  35.                     {
  36.                         leftbtn.Enabled = false;
  37.                     }
  38.                 }
  39.             }
  40.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement