private void button20_Click(object sender, EventArgs e) { Hand handhighlights = new Hand(); handhighlights = HandCombination.getTwoPair(new Hand(myHand1)); for (int i = 0; i < myHand1.Count(); i++) { for (int j = 0; j < handhighlights.Count(); j++) { if (handhighlights.getCard(j) == myHand1.getCard(i) && handhighlights.getCard(j).getSuit() == myHand1.getCard(i).getSuit()) { myHand1.getCard(i).Highlight(); } } } int x = 0; for (int i = 0; i < myHand1.Count(); i++) { Bitmap bitmap = new Bitmap(myHand1.getCard(i).getImage()); Graphics g = Graphics.FromImage(b2); g.DrawImage(bitmap, 5 + x * 75, 5, 71, 96); x++; } pictureBox1.Image = b2; //MainList.Items.Add(handhighlights.ToString()); }