Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 4th, 2013  |  syntax: None  |  size: 0.86 KB  |  views: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. List<Bitmap> avatars = new List<Bitmap>();
  2.  
  3. private void GameForm_Load(object sender, EventArgs e)
  4. {
  5.   avatars.Add(Properties.Resources.Head1);
  6.   avatars.Add(Properties.Resources.Head2);
  7.   avatars.Add(Properties.Resources.Head3);
  8.   avatars.Add(Properties.Resources.Head4);
  9. }
  10.        
  11. private void pictureBoxAvatar1_Click(object sender, EventArgs e)
  12. {
  13.  
  14.   if(pictureBoxAvatar1.Image == avatars.ElementAt(0))
  15.   {
  16.     pictureBoxAvatar1.Image = avatars.ElementAt(1);
  17.   }
  18.   //I have four total possibilities, but just have this one statement until I figure it out
  19.  
  20. }
  21.        
  22. private void pictureBoxAvatar1_Click(object sender, EventArgs e)
  23. {
  24.    pictureBoxAvatar1.ImagePointer = (pictureBoxAvatar1.ImagePointer + 1) % avatars.size();
  25. }
  26.        
  27. int avIndex = avatars.IndexOf(picturebox1.image);
  28. avIndex++;
  29. if (avIndex >= avatars.Count)
  30. {
  31.   avIndex = 0;
  32. }
  33. picturebox1.image = avatars[avIndex];