Advertisement
rdsedmundo

trackBar Increase by Multiple

Aug 24th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1.         private void trackBar1_Scroll(object sender, EventArgs e)
  2.         {
  3.             /* by Kyl3 */
  4.             int pValue = trackBar1.Value, splitter = 10, i = 0, newValue = 0;
  5.             do
  6.             {
  7.                 newValue = pValue + i;
  8.                 i++;
  9.             } while ((pValue + i) % splitter == 0);
  10.             do
  11.             {
  12.                 newValue--;
  13.             } while (newValue >= trackBar1.Maximum);
  14.             do
  15.             {
  16.                 newValue++;
  17.             } while (newValue < trackBar1.Minimum);
  18.             trackBar1.Value = newValue;
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement